mirror of
https://github.com/iv-org/invidious
synced 2024-11-23 19:43:26 +01:00
User: Fix importing FreeTube subscriptions with multiple profiles (#4011)
This commit is contained in:
commit
88cc62d45e
@ -228,8 +228,12 @@ struct Invidious::User
|
||||
subs = matches.map(&.["channel_id"])
|
||||
|
||||
if subs.empty?
|
||||
data = JSON.parse(body)["subscriptions"]
|
||||
subs = data.as_a.map(&.["id"].as_s)
|
||||
profiles = body.split('\n', remove_empty: true)
|
||||
profiles.each do |profile|
|
||||
if data = JSON.parse(profile)["subscriptions"]?
|
||||
subs += data.as_a.map(&.["id"].as_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
user.subscriptions += subs
|
||||
|
Loading…
Reference in New Issue
Block a user