diff --git a/src/invidious/routes/api/v1/authenticated.cr b/src/invidious/routes/api/v1/authenticated.cr index 0f96965c..11ffe7ff 100644 --- a/src/invidious/routes/api/v1/authenticated.cr +++ b/src/invidious/routes/api/v1/authenticated.cr @@ -226,12 +226,13 @@ module Invidious::Routes::API::V1::Authenticated end compilation = create_compilation(title, privacy, user) - env.response.headers["Location"] = "#{HOST_URL}/api/v1/auth/compilations/#{playlist.id}" + env.response.headers["Location"] = "#{HOST_URL}/api/v1/auth/compilations/#{compilation.id}" env.response.status_code = 201 { "title" => title, "compilationId" => compilation.id, }.to_json + end def self.create_playlist(env) env.response.content_type = "application/json" diff --git a/src/invidious/routing.cr b/src/invidious/routing.cr index a40bef73..434392e9 100644 --- a/src/invidious/routing.cr +++ b/src/invidious/routing.cr @@ -80,6 +80,11 @@ module Invidious::Routing get "/subscription_manager", Routes::Subscriptions, :subscription_manager end + def register_iv_compilation_routes + get "/create_compilation", Routes::Compilations, :new + post "/create_compilation", Routes::Compilations, :create + end + def register_iv_playlist_routes get "/create_playlist", Routes::Playlists, :new post "/create_playlist", Routes::Playlists, :create diff --git a/src/invidious/views/create_compilation.ecr b/src/invidious/views/create_compilation.ecr new file mode 100644 index 00000000..296d873e --- /dev/null +++ b/src/invidious/views/create_compilation.ecr @@ -0,0 +1,3 @@ +<% content_for "header" do %> +