mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Speed up manage_subscriptions
This commit is contained in:
parent
9df77707d3
commit
c099a5ad2e
1 changed files with 1 additions and 6 deletions
|
@ -1373,12 +1373,7 @@ get "/subscription_manager" do |env|
|
||||||
format = env.params.query["format"]?
|
format = env.params.query["format"]?
|
||||||
format ||= "rss"
|
format ||= "rss"
|
||||||
|
|
||||||
subscriptions = [] of InvidiousChannel
|
subscriptions = PG_DB.query_all("SELECT * FROM channels WHERE id = ANY('{#{user.subscriptions.join(",")}}')", as: InvidiousChannel)
|
||||||
user.subscriptions.each do |ucid|
|
|
||||||
if channel = PG_DB.query_one?("SELECT * FROM channels WHERE id = $1", ucid, as: InvidiousChannel)
|
|
||||||
subscriptions << channel
|
|
||||||
end
|
|
||||||
end
|
|
||||||
subscriptions.sort_by! { |channel| channel.author.downcase }
|
subscriptions.sort_by! { |channel| channel.author.downcase }
|
||||||
|
|
||||||
if action_takeout
|
if action_takeout
|
||||||
|
|
Loading…
Reference in a new issue