mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Add channel sort to '/api/v1/channels/videos'
This commit is contained in:
parent
44e9b4ac2a
commit
47ed8bd13f
1 changed files with 3 additions and 1 deletions
|
@ -2584,6 +2584,8 @@ end
|
|||
ucid = env.params.url["ucid"]
|
||||
page = env.params.query["page"]?.try &.to_i?
|
||||
page ||= 1
|
||||
sort_by = env.params.query["sort_by"]?.try &.downcase
|
||||
sort_by ||= "newest"
|
||||
|
||||
begin
|
||||
author, ucid, auto_generated = get_about_info(ucid)
|
||||
|
@ -2593,7 +2595,7 @@ end
|
|||
end
|
||||
|
||||
begin
|
||||
videos, count = get_60_videos(ucid, page, auto_generated)
|
||||
videos, count = get_60_videos(ucid, page, auto_generated, sort_by)
|
||||
rescue ex
|
||||
error_message = {"error" => ex.message}.to_json
|
||||
halt env, status_code: 500, response: error_message
|
||||
|
|
Loading…
Reference in a new issue