summaryrefslogtreecommitdiffstats
path: root/src/helpers.cr
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers.cr')
-rw-r--r--src/helpers.cr2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/helpers.cr b/src/helpers.cr
index 31893603..6a707734 100644
--- a/src/helpers.cr
+++ b/src/helpers.cr
@@ -183,8 +183,8 @@ def get_video(id, client, db, refresh = true)
# If record was last updated over an hour ago, refresh (expire param in response lasts for 6 hours)
if refresh && Time.now - video.updated > 1.hours
- video = fetch_video(id, client)
db.exec("DELETE FROM videos * WHERE id = $1", id)
+ video = fetch_video(id, client)
args = arg_array(video.to_a)
db.exec("INSERT INTO videos VALUES (#{args})", video.to_a)
end