mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-21 02:18:52 +00:00
Comments: Move link utility functions to own file + module
This commit is contained in:
@@ -362,8 +362,8 @@ module Invidious::Routes::API::V1::Videos
|
||||
return reddit_thread.to_json
|
||||
else
|
||||
content_html = Frontend::Comments.template_reddit(comments, locale)
|
||||
content_html = fill_links(content_html, "https", "www.reddit.com")
|
||||
content_html = replace_links(content_html)
|
||||
content_html = Comments.fill_links(content_html, "https", "www.reddit.com")
|
||||
content_html = Comments.replace_links(content_html)
|
||||
response = {
|
||||
"title" => reddit_thread.title,
|
||||
"permalink" => reddit_thread.permalink,
|
||||
|
||||
@@ -101,8 +101,8 @@ module Invidious::Routes::Watch
|
||||
comments, reddit_thread = Comments.fetch_reddit(id)
|
||||
comment_html = Frontend::Comments.template_reddit(comments, locale)
|
||||
|
||||
comment_html = fill_links(comment_html, "https", "www.reddit.com")
|
||||
comment_html = replace_links(comment_html)
|
||||
comment_html = Comments.fill_links(comment_html, "https", "www.reddit.com")
|
||||
comment_html = Comments.replace_links(comment_html)
|
||||
end
|
||||
end
|
||||
elsif source == "reddit"
|
||||
@@ -110,8 +110,8 @@ module Invidious::Routes::Watch
|
||||
comments, reddit_thread = Comments.fetch_reddit(id)
|
||||
comment_html = Frontend::Comments.template_reddit(comments, locale)
|
||||
|
||||
comment_html = fill_links(comment_html, "https", "www.reddit.com")
|
||||
comment_html = replace_links(comment_html)
|
||||
comment_html = Comments.fill_links(comment_html, "https", "www.reddit.com")
|
||||
comment_html = Comments.replace_links(comment_html)
|
||||
rescue ex
|
||||
if preferences.comments[1] == "youtube"
|
||||
comment_html = JSON.parse(Comments.fetch_youtube(id, nil, "html", locale, preferences.thin_mode, region))["contentHtml"]
|
||||
|
||||
Reference in New Issue
Block a user