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,24 +73,12 @@ module Invidious::Routes::Watch
if nojs if nojs
if preferences if preferences
# Disables youtube comments
source = preferences.comments[0] source = preferences.comments[0]
if source.empty? if source.empty?
source = preferences.comments[1] source = preferences.comments[1]
comment_html = JSON.parse(Comments.fetch_youtube(id, nil, "html", locale, preferences.thin_mode, region))["contentHtml"]
end 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 end
comment_html ||= "" comment_html ||= ""