Skip to content

Commit

Permalink
Remove migration points
Browse files Browse the repository at this point in the history
  • Loading branch information
omarroth committed Sep 10, 2018
1 parent e0ee1c3 commit 89bda1d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/invidious/videos.cr
Expand Up @@ -377,14 +377,11 @@ def get_video(id, db, refresh = true)
video = fetch_video(id)
video_array = video.to_a

# MIGRATION POINT
video_array = video_array[0..-2]

args = arg_array(video_array[1..-1], 2)

db.exec("UPDATE videos SET (info,updated,title,views,likes,dislikes,wilson_score,\
published,description,language,author,ucid, allowed_regions, is_family_friendly,\
genre, genre_url)\
genre, genre_url, license)\
= (#{args}) WHERE id = $1", video_array)
rescue ex
db.exec("DELETE FROM videos * WHERE id = $1", id)
Expand All @@ -395,9 +392,6 @@ def get_video(id, db, refresh = true)
video = fetch_video(id)
video_array = video.to_a

# MIGRATION POINT
video_array = video_array[0..-2]

args = arg_array(video_array)

db.exec("INSERT INTO videos VALUES (#{args}) ON CONFLICT (id) DO NOTHING", video_array)
Expand Down

0 comments on commit 89bda1d

Please sign in to comment.