Channels: Add sort options to shorts

This commit is contained in:
Samantaz Fox 2024-11-07 23:00:18 +01:00
parent cbc546f032
commit 82248fad02
No known key found for this signature in database
GPG Key ID: F42821059186176E

View File

@ -82,13 +82,12 @@ module Invidious::Routes::Channels
end end
next_continuation = nil next_continuation = nil
else else
# TODO: support sort option for shorts sort_by = env.params.query["sort_by"]?.try &.downcase || "newest"
sort_by = "" sort_options = {"newest", "oldest", "popular"}
sort_options = [] of String
# Fetch items and continuation token # Fetch items and continuation token
items, next_continuation = Channel::Tabs.get_shorts( items, next_continuation = Channel::Tabs.get_shorts(
channel, continuation: continuation channel, continuation: continuation, sort_by: sort_by
) )
end end