fix comment preferences for nojs

This commit is contained in:
Fijxu 2026-10-18 00:05:06 -03:00
parent a61118a15a
commit ba4318b62e
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4

View File

@ -73,25 +73,13 @@ module Invidious::Routes::Watch
if nojs
if preferences
# Disables youtube comments
source = preferences.comments[0]
if source.empty?
source = preferences.comments[1]
end
if source == "youtube"
begin
comment_html = JSON.parse(Comments.fetch_youtube(id, nil, "html", locale, preferences.thin_mode, region))["contentHtml"]
rescue
if preferences.comments[1] == "youtube"
comment_html = JSON.parse(Comments.fetch_youtube(id, nil, "html", locale, preferences.thin_mode, region))["contentHtml"]
end
end
end
else
comment_html = JSON.parse(Comments.fetch_youtube(id, nil, "html", locale, preferences.thin_mode, region))["contentHtml"]
end
comment_html ||= ""
end