mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Add fix for empty 'page' param
This commit is contained in:
parent
b14a8c3f3d
commit
d201733756
1 changed files with 5 additions and 5 deletions
|
@ -1139,7 +1139,7 @@ end
|
|||
|
||||
get "/api/v1/channels/:ucid/videos" do |env|
|
||||
ucid = env.params.url["ucid"]
|
||||
page = env.params.query["page"]?
|
||||
page = env.params.query["page"]?.try &.to_i?
|
||||
page ||= 1
|
||||
|
||||
url = produce_videos_url(ucid, page)
|
||||
|
@ -1346,7 +1346,7 @@ get "/search" do |env|
|
|||
next env.redirect "/"
|
||||
end
|
||||
|
||||
page = env.params.query["page"]?.try &.to_i
|
||||
page = env.params.query["page"]?.try &.to_i?
|
||||
page ||= 1
|
||||
|
||||
client = make_client(YT_URL)
|
||||
|
@ -1794,7 +1794,7 @@ get "/feed/subscriptions" do |env|
|
|||
max_results ||= env.params.query["max_results"]?.try &.to_i
|
||||
max_results ||= 40
|
||||
|
||||
page = env.params.query["page"]?.try &.to_i
|
||||
page = env.params.query["page"]?.try &.to_i?
|
||||
page ||= 1
|
||||
|
||||
if max_results < 0
|
||||
|
@ -1966,7 +1966,7 @@ get "/feed/private" do |env|
|
|||
max_results = env.params.query["max_results"]?.try &.to_i
|
||||
max_results ||= 40
|
||||
|
||||
page = env.params.query["page"]?.try &.to_i
|
||||
page = env.params.query["page"]?.try &.to_i?
|
||||
page ||= 1
|
||||
|
||||
if max_results < 0
|
||||
|
@ -2226,7 +2226,7 @@ get "/channel/:ucid" do |env|
|
|||
|
||||
ucid = env.params.url["ucid"]
|
||||
|
||||
page = env.params.query["page"]?.try &.to_i
|
||||
page = env.params.query["page"]?.try &.to_i?
|
||||
page ||= 1
|
||||
|
||||
client = make_client(YT_URL)
|
||||
|
|
Loading…
Reference in a new issue