summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-10-30 10:03:03 -0500
committerOmar Roth <omarroth@hotmail.com>2018-10-30 10:03:03 -0500
commit596960f35a0d57672ef1594897f8014d7db337ca (patch)
treecb94a4f731ba00150a10245eb5841cb5a1759faa
parente39dec97788344ad7741541707cc6d4bd91865b9 (diff)
downloadinvidious-596960f35a0d57672ef1594897f8014d7db337ca.tar.gz
invidious-596960f35a0d57672ef1594897f8014d7db337ca.tar.bz2
invidious-596960f35a0d57672ef1594897f8014d7db337ca.zip
Remove migration points
-rw-r--r--src/invidious/channels.cr25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/invidious/channels.cr b/src/invidious/channels.cr
index 877d0279..d3f4588d 100644
--- a/src/invidious/channels.cr
+++ b/src/invidious/channels.cr
@@ -97,20 +97,12 @@ def fetch_channel(ucid, client, db, pull_all_videos = true)
db.exec("UPDATE users SET notifications = notifications || $1 \
WHERE updated < $2 AND $3 = ANY(subscriptions) AND $1 <> ALL(notifications)", video.id, video.published, ucid)
- # Migration point
- video_array = video.to_a[0..-2]
- # video_array = video.to_a
-
+ video_array = video.to_a
args = arg_array(video_array)
- # Migration point
db.exec("INSERT INTO channel_videos VALUES (#{args}) \
- ON CONFLICT (id) DO UPDATE SET title = $2, published = $3, \
- updated = $4, ucid = $5, author = $6", video_array)
-
- # db.exec("INSERT INTO channel_videos VALUES (#{args}) \
- # ON CONFLICT (id) DO UPDATE SET title = $2, published = $3, \
- # updated = $4, ucid = $5, author = $6, length_seconds = $7", video_array)
+ ON CONFLICT (id) DO UPDATE SET title = $2, published = $3, \
+ updated = $4, ucid = $5, author = $6, length_seconds = $7", video_array)
end
else
page = 1
@@ -147,18 +139,11 @@ def fetch_channel(ucid, client, db, pull_all_videos = true)
db.exec("UPDATE users SET notifications = notifications || $1 \
WHERE updated < $2 AND $3 = ANY(subscriptions) AND $1 <> ALL(notifications)", video.id, video.published, video.ucid)
- # Migration point
- video_array = video.to_a[0..-2]
- # video_array = video.to_a
-
+ video_array = video.to_a
args = arg_array(video_array)
- # Migration point
db.exec("INSERT INTO channel_videos VALUES (#{args}) ON CONFLICT (id) DO UPDATE SET title = $2, \
- published = $3, updated = $4, ucid = $5, author = $6", video_array)
-
- # db.exec("INSERT INTO channel_videos VALUES (#{args}) ON CONFLICT (id) DO UPDATE SET title = $2, \
- # published = $3, updated = $4, ucid = $5, author = $6, length_seconds = $7", video_array)
+ published = $3, updated = $4, ucid = $5, author = $6, length_seconds = $7", video_array)
end
end