mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Add /subscription_manager
This commit is contained in:
parent
1ada71e5ba
commit
431fa642bf
4 changed files with 40 additions and 1 deletions
|
@ -806,6 +806,24 @@ get "/modify_notifications" do |env|
|
|||
env.redirect referer
|
||||
end
|
||||
|
||||
get "/subscription_manager" do |env|
|
||||
authorized = env.get? "authorized"
|
||||
if !authorized
|
||||
next env.redirect "/"
|
||||
end
|
||||
|
||||
subscriptions = env.get?("subscriptions").as(Array(String))
|
||||
subscriptions ||= [] of String
|
||||
|
||||
client = make_client(YT_URL)
|
||||
subscriptions = subscriptions.map do |ucid|
|
||||
get_channel(ucid, client, PG_DB, false)
|
||||
end
|
||||
subscriptions.sort_by! { |channel| channel.author.downcase }
|
||||
|
||||
templated "subscription_manager"
|
||||
end
|
||||
|
||||
get "/subscription_ajax" do |env|
|
||||
authorized = env.get? "authorized"
|
||||
referer = env.request.headers["referer"]?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue