summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-02-26 18:59:02 -0600
committerOmar Roth <omarroth@hotmail.com>2018-02-26 18:59:02 -0600
commit3a95d21808fd4838d5139419934a3834fb61779d (patch)
tree8f4e2dc0f3b20deeb9eaf20b91f2b7b81e199e63
parent7828cd97672d068e5d4f255aeea676d755e27c0f (diff)
downloadinvidious-3a95d21808fd4838d5139419934a3834fb61779d.tar.gz
invidious-3a95d21808fd4838d5139419934a3834fb61779d.tar.bz2
invidious-3a95d21808fd4838d5139419934a3834fb61779d.zip
Minor fixes
-rw-r--r--src/helpers.cr2
-rw-r--r--src/invidious.cr6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/helpers.cr b/src/helpers.cr
index 30e544e5..dd62cfc0 100644
--- a/src/helpers.cr
+++ b/src/helpers.cr
@@ -223,7 +223,7 @@ def rank_videos(db, n)
end
def make_client(url, context)
- client = HTTP::Client.new(URL, CONTEXT)
+ client = HTTP::Client.new(url, context)
client.read_timeout = 10.seconds
client.connect_timeout = 10.seconds
return client
diff --git a/src/invidious.cr b/src/invidious.cr
index 3a0c91e1..009e59df 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -81,7 +81,7 @@ threads.times do
id = ids[0]
video = get_video(id, client, PG_DB)
rescue ex
- io << id << " : " << ex << "\n"
+ io << id << " : " << ex.message << "\n"
pool << make_client(URL, CONTEXT)
next
ensure
@@ -157,11 +157,10 @@ get "/watch" do |env|
next
end
+ listen = false
if env.params.query["listen"]? && env.params.query["listen"] == "true"
listen = true
env.params.query.delete_all("listen")
- else
- listen = false
end
client = get_client(pool)
@@ -233,6 +232,7 @@ get "/search" do |env|
env.redirect "/"
next
end
+
page = env.params.query["page"]? && env.params.query["page"].to_i? ? env.params.query["page"].to_i : 1
client = get_client(pool)