Add sort options to streams

This commit is contained in:
src-tinkerer
2023-11-01 21:56:25 +03:30
parent 8087e64dfe
commit b0df3774db
3 changed files with 86 additions and 13 deletions

View File

@@ -207,11 +207,12 @@ module Invidious::Routes::API::V1::Channels
get_channel()
# Retrieve continuation from URL parameters
sort_by = env.params.query["sort_by"]?.try &.downcase || "newest"
continuation = env.params.query["continuation"]?
begin
videos, next_continuation = Channel::Tabs.get_60_livestreams(
channel, continuation: continuation
channel, continuation: continuation, sort_by: sort_by
)
rescue ex
return error_json(500, ex)