From 025e7555420a88757aa8709419e8f09ba654854d Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sat, 4 Mar 2023 19:14:28 -0500 Subject: [PATCH] Use single db call --- src/invidious/database/users.cr | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/invidious/database/users.cr b/src/invidious/database/users.cr index f8422874..d54e6a76 100644 --- a/src/invidious/database/users.cr +++ b/src/invidious/database/users.cr @@ -50,10 +50,9 @@ module Invidious::Database::Users end def mark_watched(user : User, vid : String) - mark_unwatched(user, vid) request = <<-SQL UPDATE users - SET watched = array_append(watched, $1) + SET watched = array_append(array_remove(watched, $1), $1) WHERE email = $2 SQL