Fix Style/IsAFilter issues

This commit is contained in:
syeopite 2021-09-24 19:57:46 -07:00
parent e969c1490a
commit dd8c412abc
No known key found for this signature in database
GPG key ID: 6FA616E5A5294A82
4 changed files with 4 additions and 6 deletions

View file

@ -132,8 +132,6 @@ def error_redirect_helper(env : HTTP::Server::Context, locale : Hash(String, JSO
</li> </li>
</ul> </ul>
END_HTML END_HTML
return next_step_html
else else
return "" return ""
end end

View file

@ -29,7 +29,7 @@ module Invidious::Routes::Channels
item.author item.author
end end
end end
items = items.select(&.is_a?(SearchPlaylist)).map(&.as(SearchPlaylist)) items = items.select(SearchPlaylist).map(&.as(SearchPlaylist))
items.each(&.author=("")) items.each(&.author=(""))
else else
sort_options = {"newest", "oldest", "popular"} sort_options = {"newest", "oldest", "popular"}
@ -57,7 +57,7 @@ module Invidious::Routes::Channels
end end
items, continuation = fetch_channel_playlists(channel.ucid, channel.author, continuation, sort_by) 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=("")) items.each(&.author=(""))
templated "playlists" templated "playlists"

View file

@ -245,7 +245,7 @@ module Invidious::Routes::Playlists
if query if query
begin begin
search_query, count, items, operators = process_search_query(query, page, user, region: nil) 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 rescue ex
videos = [] of SearchVideo videos = [] of SearchVideo
count = 0 count = 0

View file

@ -40,7 +40,7 @@ def extract_videos(initial_data : Hash(String, JSON::Any), author_fallback : Str
target << i target << i
end end
end end
return target.select(&.is_a?(SearchVideo)).map(&.as(SearchVideo)) return target.select(SearchVideo).map(&.as(SearchVideo))
end end
def extract_selected_tab(tabs) def extract_selected_tab(tabs)