User: Fix importing FreeTube subscriptions with multiple profiles (#4011)

このコミットが含まれているのは:
Samantaz Fox 2023-10-21 18:31:18 +02:00
コミット 88cc62d45e
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: F42821059186176E
1個のファイルの変更6行の追加2行の削除

ファイルの表示

@ -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