mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-21 02:18:52 +00:00
Comments: Move 'fetch_reddit' function to own file + module
This commit is contained in:
@@ -345,7 +345,7 @@ module Invidious::Routes::API::V1::Videos
|
||||
sort_by ||= "confidence"
|
||||
|
||||
begin
|
||||
comments, reddit_thread = fetch_reddit_comments(id, sort_by: sort_by)
|
||||
comments, reddit_thread = Comments.fetch_reddit(id, sort_by: sort_by)
|
||||
rescue ex
|
||||
comments = nil
|
||||
reddit_thread = nil
|
||||
|
||||
@@ -98,7 +98,7 @@ module Invidious::Routes::Watch
|
||||
comment_html = JSON.parse(Comments.fetch_youtube(id, nil, "html", locale, preferences.thin_mode, region))["contentHtml"]
|
||||
rescue ex
|
||||
if preferences.comments[1] == "reddit"
|
||||
comments, reddit_thread = fetch_reddit_comments(id)
|
||||
comments, reddit_thread = Comments.fetch_reddit(id)
|
||||
comment_html = template_reddit_comments(comments, locale)
|
||||
|
||||
comment_html = fill_links(comment_html, "https", "www.reddit.com")
|
||||
@@ -107,7 +107,7 @@ module Invidious::Routes::Watch
|
||||
end
|
||||
elsif source == "reddit"
|
||||
begin
|
||||
comments, reddit_thread = fetch_reddit_comments(id)
|
||||
comments, reddit_thread = Comments.fetch_reddit(id)
|
||||
comment_html = template_reddit_comments(comments, locale)
|
||||
|
||||
comment_html = fill_links(comment_html, "https", "www.reddit.com")
|
||||
|
||||
Reference in New Issue
Block a user