Comments: Move 'template_reddit' function to own file + module

This commit is contained in:
Samantaz Fox
2023-05-06 20:12:02 +02:00
parent e10f6b6626
commit de78848039
4 changed files with 53 additions and 50 deletions

View File

@@ -361,7 +361,7 @@ module Invidious::Routes::API::V1::Videos
return reddit_thread.to_json
else
content_html = template_reddit_comments(comments, locale)
content_html = Frontend::Comments.template_reddit(comments, locale)
content_html = fill_links(content_html, "https", "www.reddit.com")
content_html = replace_links(content_html)
response = {

View File

@@ -99,7 +99,7 @@ module Invidious::Routes::Watch
rescue ex
if preferences.comments[1] == "reddit"
comments, reddit_thread = Comments.fetch_reddit(id)
comment_html = template_reddit_comments(comments, locale)
comment_html = Frontend::Comments.template_reddit(comments, locale)
comment_html = fill_links(comment_html, "https", "www.reddit.com")
comment_html = replace_links(comment_html)
@@ -108,7 +108,7 @@ module Invidious::Routes::Watch
elsif source == "reddit"
begin
comments, reddit_thread = Comments.fetch_reddit(id)
comment_html = template_reddit_comments(comments, locale)
comment_html = Frontend::Comments.template_reddit(comments, locale)
comment_html = fill_links(comment_html, "https", "www.reddit.com")
comment_html = replace_links(comment_html)