summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-07-29 21:09:57 -0500
committerOmar Roth <omarroth@hotmail.com>2018-07-29 21:17:08 -0500
commitd201733756bc0eb1c04cf87e5fbd5b5f7d68e129 (patch)
treea28db24c6289257ff2f9cefeb045d9b391a281af /src
parentb14a8c3f3daff01f9b064e50a6d57237f1ec4902 (diff)
downloadinvidious-d201733756bc0eb1c04cf87e5fbd5b5f7d68e129.tar.gz
invidious-d201733756bc0eb1c04cf87e5fbd5b5f7d68e129.tar.bz2
invidious-d201733756bc0eb1c04cf87e5fbd5b5f7d68e129.zip
Add fix for empty 'page' param
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 16a2d458..1a739ae4 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -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)