mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-27 01:01:59 +05:30
Fix importing FreeTube subscriptions with multiple profiles
Co-Authored-By: Samantaz Fox <coding@samantaz.fr>
This commit is contained in:
parent
069e91d2a6
commit
0bd415158f
@ -228,8 +228,12 @@ struct Invidious::User
|
|||||||
subs = matches.map(&.["channel_id"])
|
subs = matches.map(&.["channel_id"])
|
||||||
|
|
||||||
if subs.empty?
|
if subs.empty?
|
||||||
data = JSON.parse(body)["subscriptions"]
|
profiles = body.split('\n', remove_empty: true)
|
||||||
subs = data.as_a.map(&.["id"].as_s)
|
profiles.each do |profile|
|
||||||
|
if data = JSON.parse(profile)["subscriptions"]?
|
||||||
|
subs += data.as_a.map(&.["id"].as_s)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
user.subscriptions += subs
|
user.subscriptions += subs
|
||||||
|
Loading…
Reference in New Issue
Block a user