mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Refresh account for subscription feed and manager
This commit is contained in:
parent
cecb93f832
commit
7119395045
1 changed files with 15 additions and 0 deletions
|
@ -750,6 +750,13 @@ get "/feed/subscriptions" do |env|
|
|||
if user
|
||||
user = user.as(User)
|
||||
|
||||
# Refresh account
|
||||
headers = HTTP::Headers.new
|
||||
headers["Cookie"] = env.request.headers["Cookie"]
|
||||
|
||||
client = make_client(YT_URL)
|
||||
user = get_user(user.id, client, headers, PG_DB)
|
||||
|
||||
max_results = user.preferences.max_results
|
||||
max_results ||= env.params.query["maxResults"]?.try &.to_i
|
||||
max_results ||= 40
|
||||
|
@ -848,6 +855,14 @@ get "/subscription_manager" do |env|
|
|||
end
|
||||
|
||||
user = user.as(User)
|
||||
|
||||
# Refresh account
|
||||
headers = HTTP::Headers.new
|
||||
headers["Cookie"] = env.request.headers["Cookie"]
|
||||
|
||||
client = make_client(YT_URL)
|
||||
user = get_user(user.id, client, headers, PG_DB)
|
||||
|
||||
subscriptions = user.subscriptions
|
||||
subscriptions ||= [] of String
|
||||
|
||||
|
|
Loading…
Reference in a new issue