Merge pull request #443 from TeamPiped/playlist-owner-fetch

Don't join users table when adding / removing videos from playlist
This commit is contained in:
Kavin 2022-11-17 02:07:47 +00:00 committed by GitHub
commit d0cdec5b72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -224,7 +224,6 @@ public class AuthPlaylistHandlers {
var query = cb.createQuery(me.kavin.piped.utils.obj.db.Playlist.class); var query = cb.createQuery(me.kavin.piped.utils.obj.db.Playlist.class);
var root = query.from(me.kavin.piped.utils.obj.db.Playlist.class); var root = query.from(me.kavin.piped.utils.obj.db.Playlist.class);
root.fetch("videos", JoinType.LEFT); root.fetch("videos", JoinType.LEFT);
root.fetch("owner", JoinType.LEFT);
query.where(cb.equal(root.get("playlist_id"), UUID.fromString(playlistId))); query.where(cb.equal(root.get("playlist_id"), UUID.fromString(playlistId)));
var playlist = s.createQuery(query).uniqueResult(); var playlist = s.createQuery(query).uniqueResult();
@ -280,7 +279,6 @@ public class AuthPlaylistHandlers {
var query = cb.createQuery(me.kavin.piped.utils.obj.db.Playlist.class); var query = cb.createQuery(me.kavin.piped.utils.obj.db.Playlist.class);
var root = query.from(me.kavin.piped.utils.obj.db.Playlist.class); var root = query.from(me.kavin.piped.utils.obj.db.Playlist.class);
root.fetch("videos", JoinType.LEFT); root.fetch("videos", JoinType.LEFT);
root.fetch("owner", JoinType.LEFT);
query.where(cb.equal(root.get("playlist_id"), UUID.fromString(playlistId))); query.where(cb.equal(root.get("playlist_id"), UUID.fromString(playlistId)));
var playlist = s.createQuery(query).uniqueResult(); var playlist = s.createQuery(query).uniqueResult();