Apply suggestions from code review

Co-authored-by: Samantaz Fox <coding@samantaz.fr>
This commit is contained in:
ChunkyProgrammer 2023-08-04 11:14:57 -04:00
parent d046423d67
commit df15cf91ff
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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)
)