Fix for playlist video ordering.

This commit is contained in:
Kavin 2022-11-19 00:17:34 +00:00
parent 5b296eb488
commit 030bf0aa30
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -130,7 +130,7 @@ public class DatabaseHelper {
}
public static List<PlaylistVideo> getPlaylistVideosFromPlaylistId(SharedSessionContract s, String id, boolean fetchChannel) {
var query = s.createNativeQuery("SELECT {playlist_videos.*}, {channels.*} FROM playlist_videos JOIN channels ON playlist_videos.uploader_id = channels.uploader_id JOIN playlists_videos_ids ON playlist_videos.id = playlists_videos_ids.videos_id JOIN playlists ON playlists.id = playlists_videos_ids.playlist_id WHERE playlists.playlist_id = :id")
var query = s.createNativeQuery("SELECT {playlist_videos.*}, {channels.*} FROM playlist_videos JOIN channels ON playlist_videos.uploader_id = channels.uploader_id JOIN playlists_videos_ids ON playlist_videos.id = playlists_videos_ids.videos_id JOIN playlists ON playlists.id = playlists_videos_ids.playlist_id WHERE playlists.playlist_id = :id ORDER BY playlists_videos_ids.videos_order ASC")
.addEntity("playlist_videos", PlaylistVideo.class)
.addEntity("channels", Channel.class)
.setParameter("id", UUID.fromString(id));