From 6e0df50a03120ed3327a93bf98f1a3613f00b3dd Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sat, 13 Oct 2018 20:03:48 -0500 Subject: [PATCH] Remove migration points --- src/invidious/videos.cr | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 28b0922b..ddee9441 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -492,20 +492,12 @@ def get_video(id, db, proxies = {} of String => Array({ip: String, port: Int32}) video = fetch_video(id, proxies) video_array = video.to_a - # Migration point - video_array = video_array[0..-2] - args = arg_array(video_array[1..-1], 2) - # Migration point - # 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,license,sub_count_text,author_thumbnail)\ - # = (#{args}) WHERE id = $1", video_array) 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,license,sub_count_text)\ - = (#{args}) WHERE id = $1", video_array) + published,description,language,author,ucid,allowed_regions,is_family_friendly,\ + genre,genre_url,license,sub_count_text,author_thumbnail)\ + = (#{args}) WHERE id = $1", video_array) rescue ex db.exec("DELETE FROM videos * WHERE id = $1", id) raise ex @@ -515,9 +507,6 @@ def get_video(id, db, proxies = {} of String => Array({ip: String, port: Int32}) video = fetch_video(id, proxies) 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)