From ff91ec820c91feb9135e10e2cf3f8b2acf33c8cc Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 5 Apr 2018 20:07:14 -0500 Subject: [PATCH] Remove notifications once viewed --- src/invidious.cr | 1 + 1 file changed, 1 insertion(+) diff --git a/src/invidious.cr b/src/invidious.cr index 7307b255..461f3128 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -594,6 +594,7 @@ get "/feed/subscriptions" do |env| videos = PG_DB.query_all("SELECT * FROM channel_videos WHERE ucid IN (#{args}) \ ORDER BY published DESC LIMIT $1 OFFSET $2", [max_results, offset] + user.subscriptions, as: ChannelVideo) + PG_DB.exec("UPDATE users SET notifications = $1 WHERE id = $2", [] of String, sid) env.set "notifications", 0 templated "subscriptions"