From dd8c412abc90148b50cebc06546b750898b1fe8a Mon Sep 17 00:00:00 2001 From: syeopite Date: Fri, 24 Sep 2021 19:57:46 -0700 Subject: [PATCH] Fix Style/IsAFilter issues --- src/invidious/helpers/errors.cr | 2 -- src/invidious/routes/channels.cr | 4 ++-- src/invidious/routes/playlists.cr | 2 +- src/invidious/yt_backend/extractors_utils.cr | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index e1d02563..e5c77fbc 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -132,8 +132,6 @@ def error_redirect_helper(env : HTTP::Server::Context, locale : Hash(String, JSO END_HTML - - return next_step_html else return "" end diff --git a/src/invidious/routes/channels.cr b/src/invidious/routes/channels.cr index bfcc3edd..619159a2 100644 --- a/src/invidious/routes/channels.cr +++ b/src/invidious/routes/channels.cr @@ -29,7 +29,7 @@ module Invidious::Routes::Channels item.author end end - items = items.select(&.is_a?(SearchPlaylist)).map(&.as(SearchPlaylist)) + items = items.select(SearchPlaylist).map(&.as(SearchPlaylist)) items.each(&.author=("")) else sort_options = {"newest", "oldest", "popular"} @@ -57,7 +57,7 @@ module Invidious::Routes::Channels end items, continuation = fetch_channel_playlists(channel.ucid, channel.author, continuation, sort_by) - items = items.select { |item| item.is_a?(SearchPlaylist) }.map { |item| item.as(SearchPlaylist) } + items = items.select(SearchPlaylist).map { |item| item.as(SearchPlaylist) } items.each(&.author=("")) templated "playlists" diff --git a/src/invidious/routes/playlists.cr b/src/invidious/routes/playlists.cr index 5ab15093..13d99946 100644 --- a/src/invidious/routes/playlists.cr +++ b/src/invidious/routes/playlists.cr @@ -245,7 +245,7 @@ module Invidious::Routes::Playlists if query begin search_query, count, items, operators = process_search_query(query, page, user, region: nil) - videos = items.select { |item| item.is_a? SearchVideo }.map { |item| item.as(SearchVideo) } + videos = items.select(SearchVideo).map { |item| item.as(SearchVideo) } rescue ex videos = [] of SearchVideo count = 0 diff --git a/src/invidious/yt_backend/extractors_utils.cr b/src/invidious/yt_backend/extractors_utils.cr index 97cc0997..add5f488 100644 --- a/src/invidious/yt_backend/extractors_utils.cr +++ b/src/invidious/yt_backend/extractors_utils.cr @@ -40,7 +40,7 @@ def extract_videos(initial_data : Hash(String, JSON::Any), author_fallback : Str target << i end end - return target.select(&.is_a?(SearchVideo)).map(&.as(SearchVideo)) + return target.select(SearchVideo).map(&.as(SearchVideo)) end def extract_selected_tab(tabs)