Channels: Add sort options to shorts
All checks were successful
Invidious CI / build (push) Successful in 5m7s

Signed-off-by: Fijxu <fijxu@nadeko.net>
This commit is contained in:
Samantaz Fox 2024-11-07 23:00:18 +01:00 committed by Fijxu
parent 8487e01064
commit 46d39c3066
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

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