mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 14:03:37 +00:00
Add create_compilation route and ecr
This commit is contained in:
parent
b6181b9d97
commit
bac4fd9097
@ -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"
|
||||
|
@ -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
|
||||
|
3
src/invidious/views/create_compilation.ecr
Normal file
3
src/invidious/views/create_compilation.ecr
Normal file
@ -0,0 +1,3 @@
|
||||
<% content_for "header" do %>
|
||||
<title><%= translate(locale, "Create compilation") %> - Invidious</title>
|
||||
<% end %>
|
Loading…
Reference in New Issue
Block a user