From 38110801a7dc950b8fb8b7c4d72896128ef46a9b Mon Sep 17 00:00:00 2001 From: syeopite Date: Sat, 14 Aug 2021 18:42:13 -0700 Subject: [PATCH] Fix lint --- src/invidious/helpers/extractors.cr | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/invidious/helpers/extractors.cr b/src/invidious/helpers/extractors.cr index cbf397e3..dacc4ceb 100644 --- a/src/invidious/helpers/extractors.cr +++ b/src/invidious/helpers/extractors.cr @@ -358,28 +358,28 @@ private module Parsers end end - # YouTube doesn't provide dislikes. - likes = short_text_to_number(item_contents["voteCount"]["simpleText"].as_s.split(" ")[0]) + # YouTube doesn't provide dislikes. + likes = short_text_to_number(item_contents["voteCount"]["simpleText"].as_s.split(" ")[0]) - comments = item_contents.dig?("actionButtons", "commentActionButtonsRenderer", - "replyButton", "buttonRenderer", "text", "simpleText").try { |t| short_text_to_number(t.as_s) } || 0 + comments = item_contents.dig?("actionButtons", "commentActionButtonsRenderer", + "replyButton", "buttonRenderer", "text", "simpleText").try { |t| short_text_to_number(t.as_s) } || 0 - published = item_contents["publishedTimeText"]["runs"][0]["text"].try { |t| decode_date(t.as_s.rstrip(" (edited)")) } || Time.local + published = item_contents["publishedTimeText"]["runs"][0]["text"].try { |t| decode_date(t.as_s.rstrip(" (edited)")) } || Time.local - YouTubeStructs::CommunityPost.new({ - author: author_name, - author_id: author_id, - author_thumbnail: author_thumbnail, - post_id: post_id, - content_html: contents, - attachment: attachment, - likes: likes, - comments: comments, - published: published, - }) + YouTubeStructs::CommunityPost.new({ + author: author_name, + author_id: author_id, + author_thumbnail: author_thumbnail, + post_id: post_id, + content_html: contents, + attachment: attachment, + likes: likes, + comments: comments, + published: published, + }) + end end end -end # The following are the extractors for extracting an array of items from # the internal Youtube API's JSON response. The result is then packaged into