diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2024-11-07 23:00:18 +0100 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2024-11-07 23:08:36 +0100 |
| commit | 82248fad024de5289011e2ae26d5c390d5084827 (patch) | |
| tree | f30be8fef97713b661d073c459aa5111c1e90d59 | |
| parent | cbc546f0320e4833927a654c26d384bb2e8a9f93 (diff) | |
| download | invidious-82248fad024de5289011e2ae26d5c390d5084827.tar.gz invidious-82248fad024de5289011e2ae26d5c390d5084827.tar.bz2 invidious-82248fad024de5289011e2ae26d5c390d5084827.zip | |
Channels: Add sort options to shorts
| -rw-r--r-- | src/invidious/routes/channels.cr | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/invidious/routes/channels.cr b/src/invidious/routes/channels.cr index 952098e0..d4e9fa68 100644 --- a/src/invidious/routes/channels.cr +++ b/src/invidious/routes/channels.cr @@ -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 |
