From 8ed9624e0a1d54cd5b88785275543aa706721696 Mon Sep 17 00:00:00 2001
From: Omar Roth <omarroth@hotmail.com>
Date: Thu, 26 Jul 2018 16:30:39 -0500
Subject: [PATCH] Fix bug in delivering user notifications

---
 src/invidious/helpers.cr | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/invidious/helpers.cr b/src/invidious/helpers.cr
index 037a451e..38283b7d 100644
--- a/src/invidious/helpers.cr
+++ b/src/invidious/helpers.cr
@@ -673,7 +673,7 @@ def fetch_channel(ucid, client, db, pull_all_videos = true)
       video = ChannelVideo.new(video_id, title, published, Time.now, ucid, author)
 
       db.exec("UPDATE users SET notifications = notifications || $1 \
-      WHERE updated < $2 AND $3 = ANY(subscriptions) AND $1 <> ALL(notifications)", video.id, Time.now, ucid)
+      WHERE updated < $2 AND $3 = ANY(subscriptions) AND $1 <> ALL(notifications)", video.id, video.published, ucid)
 
       video_array = video.to_a
       args = arg_array(video_array)