mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Use &.methods where possible instead of curly braces
This commit is contained in:
parent
b2a738cf13
commit
9233f71549
1 changed files with 1 additions and 1 deletions
|
@ -276,7 +276,7 @@ def fetch_reddit_comments(id, sort_by = "confidence")
|
||||||
|
|
||||||
# For videos that have more than one thread, choose the one with the highest score
|
# For videos that have more than one thread, choose the one with the highest score
|
||||||
threads = search_results.data.as(RedditListing).children
|
threads = search_results.data.as(RedditListing).children
|
||||||
thread = threads.max_by? { |child| child.data.as(RedditLink).score }.try(&.data.as(RedditLink))
|
thread = threads.max_by?(&.data.as(RedditLink).score).try(&.data.as(RedditLink))
|
||||||
result = thread.try do |t|
|
result = thread.try do |t|
|
||||||
body = client.get("/r/#{t.subreddit}/comments/#{t.id}.json?limit=100&sort=#{sort_by}", headers).body
|
body = client.get("/r/#{t.subreddit}/comments/#{t.id}.json?limit=100&sort=#{sort_by}", headers).body
|
||||||
Array(RedditThing).from_json(body)
|
Array(RedditThing).from_json(body)
|
||||||
|
|
Loading…
Reference in a new issue