Comments: Add support for new format (#4576)

The new comment format is similar to the description's commandRuns.

This should fix the issues with most comments but there are still
some more changes that would need to be made like adding support for
formatting (bold, italic, underline) and channel emojis.

Fixes issue 4566
This commit is contained in:
Samantaz Fox
2024-04-26 23:45:44 +02:00
5 changed files with 148 additions and 70 deletions

View File

@@ -394,7 +394,7 @@ module Invidious::Routes::API::V1::Channels
else
comments = YoutubeAPI.browse(continuation: continuation)
end
return Comments.parse_youtube(id, comments, format, locale, thin_mode, isPost: true)
return Comments.parse_youtube(id, comments, format, locale, thin_mode, is_post: true)
end
def self.channels(env)

View File

@@ -231,7 +231,7 @@ module Invidious::Routes::Channels
if nojs
comments = Comments.fetch_community_post_comments(ucid, id)
comment_html = JSON.parse(Comments.parse_youtube(id, comments, "html", locale, thin_mode, isPost: true))["contentHtml"]
comment_html = JSON.parse(Comments.parse_youtube(id, comments, "html", locale, thin_mode, is_post: true))["contentHtml"]
end
templated "post"
end