From 6c12f58ffbbfc103f9a90a0ac66c3eb36cc60d49 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Sun, 8 Jan 2023 14:44:33 +0000 Subject: [PATCH] Try removing join and replacing array altogether. --- .../kavin/piped/server/handlers/auth/AuthPlaylistHandlers.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/me/kavin/piped/server/handlers/auth/AuthPlaylistHandlers.java b/src/main/java/me/kavin/piped/server/handlers/auth/AuthPlaylistHandlers.java index c794215..f1c6105 100644 --- a/src/main/java/me/kavin/piped/server/handlers/auth/AuthPlaylistHandlers.java +++ b/src/main/java/me/kavin/piped/server/handlers/auth/AuthPlaylistHandlers.java @@ -327,7 +327,6 @@ public class AuthPlaylistHandlers { var cb = s.getCriteriaBuilder(); var query = cb.createQuery(me.kavin.piped.utils.obj.db.Playlist.class); var root = query.from(me.kavin.piped.utils.obj.db.Playlist.class); - root.fetch("videos", JoinType.RIGHT); query.where(cb.equal(root.get("playlist_id"), UUID.fromString(playlistId))); var playlist = s.createQuery(query).uniqueResult(); @@ -339,7 +338,7 @@ public class AuthPlaylistHandlers { return mapper.writeValueAsBytes(mapper.createObjectNode() .put("error", "You are not the owner this playlist")); - playlist.getVideos().clear(); + playlist.setVideos(new ObjectArrayList<>()); var tr = s.beginTransaction(); s.merge(playlist);