From df15cf91ffaf71ce9b26a8a55b888d6803f918b7 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Fri, 4 Aug 2023 11:14:57 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Samantaz Fox --- src/invidious/channels/about.cr | 3 ++- src/invidious/routes/channels.cr | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/invidious/channels/about.cr b/src/invidious/channels/about.cr index 8301ca43..8a03c419 100644 --- a/src/invidious/channels/about.cr +++ b/src/invidious/channels/about.cr @@ -59,7 +59,8 @@ def get_about_info(ucid, locale) : AboutChannel # ex: https://www.youtube.com/channel/UCQvWX73GQygcwXOTSf_VDVg/ description_node = description_base_node.dig?("simpleText") || description_base_node - tags = initdata.dig?("header", "interactiveTabbedHeaderRenderer", "badges").try &.as_a.map(&.["metadataBadgeRenderer"]["label"].as_s) || [] of String + tags = initdata.dig?("header", "interactiveTabbedHeaderRenderer", "badges") + .try &.as_a.map(&.["metadataBadgeRenderer"]["label"].as_s) || [] of String else author = initdata["metadata"]["channelMetadataRenderer"]["title"].as_s author_url = initdata["metadata"]["channelMetadataRenderer"]["channelUrl"].as_s diff --git a/src/invidious/routes/channels.cr b/src/invidious/routes/channels.cr index 087d9c92..d006985e 100644 --- a/src/invidious/routes/channels.cr +++ b/src/invidious/routes/channels.cr @@ -102,12 +102,12 @@ module Invidious::Routes::Channels if channel.auto_generated sort_options = {"albums_and_singles", "created_playlists"} - sort_by = env.params.query["sort_by"]?.try &.downcase || sort_options[0] else sort_options = {"last", "oldest", "newest"} - sort_by = env.params.query["sort_by"]?.try &.downcase || sort_options[0] end + sort_by = env.params.query["sort_by"]?.try &.downcase || sort_options[0] + items, next_continuation = fetch_channel_playlists( channel.ucid, channel.author, continuation, (sort_by) )