From 8aefd7023de6458ca93ff8a12571eaaf960b2436 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Fri, 28 Jul 2023 11:46:34 +0100 Subject: [PATCH] Use excluded in DO UPDATE SET --- src/main/java/me/kavin/piped/utils/VideoHelpers.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/me/kavin/piped/utils/VideoHelpers.java b/src/main/java/me/kavin/piped/utils/VideoHelpers.java index 3049c1d..7984246 100644 --- a/src/main/java/me/kavin/piped/utils/VideoHelpers.java +++ b/src/main/java/me/kavin/piped/utils/VideoHelpers.java @@ -162,9 +162,7 @@ public class VideoHelpers { s.createNativeMutationQuery( "INSERT INTO videos (uploader_id,duration,is_short,thumbnail,title,uploaded,views,id) values " + "(:uploader_id,:duration,:is_short,:thumbnail,:title,:uploaded,:views,:id) ON CONFLICT (id) DO UPDATE SET " + - "duration = :duration," + - "title = :title," + - "views = :views" + "duration = excluded.duration, title = excluded.title, views = excluded.views" ) .setParameter("uploader_id", video.getChannel()) .setParameter("duration", video.getDuration())