diff --git a/src/invidious/frontend/comments_youtube.cr b/src/invidious/frontend/comments_youtube.cr index 37aca49e..f0c6ff98 100644 --- a/src/invidious/frontend/comments_youtube.cr +++ b/src/invidious/frontend/comments_youtube.cr @@ -214,211 +214,3 @@ module Invidious::Frontend::Comments end end end -module Invidious::Frontend::Comments - extend self - - def template_youtube(comments, locale, thin_mode, is_replies = false) - String.build do |html| - root = comments["comments"].as_a - root.each do |child| - if child["replies"]? - replies_count_text = I18n.translate_count(locale, - "comments_view_x_replies", - child["replies"]["replyCount"].as_i64 || 0, - I18n::NumberFormatting::Separator - ) - - replies_html = <<-END_HTML -
- - #{author_name} - - #{sponsor_icon} -
#{child["contentHtml"]}
- END_HTML - - if child["attachment"]? - attachment = child["attachment"] - - case attachment["type"] - when "image" - attachment = attachment["imageThumbnails"][1] - - html << <<-END_HTML -#{attachment["error"]}
-
- #{I18n.translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64), locale))} #{child["isEdited"] == true ? I18n.translate(locale, "(edited)") : ""}
- |
- END_HTML
-
- if comments["videoId"]?
- html << <<-END_HTML
- [YT]
- |
- END_HTML
- elsif comments["authorId"]?
- html << <<-END_HTML
- [YT]
- |
- END_HTML
- end
-
- html << <<-END_HTML
- #{number_with_separator(child["likeCount"])}
- END_HTML
-
- if child["creatorHeart"]?
- if !thin_mode
- creator_thumbnail = "/ggpht#{URI.parse(child["creatorHeart"]["creatorThumbnail"].as_s).request_target}"
- else
- creator_thumbnail = ""
- end
-
- html << <<-END_HTML
-
-
-
-
-
-
-
-
-
- END_HTML
- end
-
- html << <<-END_HTML
-