Channels: Add sort options to streams (#4224)

This commit is contained in:
Samantaz Fox
2024-07-10 22:28:22 +02:00
3 changed files with 26 additions and 22 deletions

View File

@@ -208,11 +208,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)