]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video.ts
Playlist reorder support
[github/Chocobozzz/PeerTube.git] / server / models / video / video.ts
index 06c63e87c42a0a372e3c372230d9f4bdde1e98b8..7624b064904c63e83c382ab6e487aec776fe727f 100644 (file)
@@ -240,7 +240,10 @@ type AvailableForListIDsOptions = {
     if (options.videoPlaylistId) {
       query.include.push({
         model: VideoPlaylistElementModel.unscoped(),
-        required: true
+        required: true,
+        where: {
+          videoPlaylistId: options.videoPlaylistId
+        }
       })
     }
 
@@ -304,6 +307,8 @@ type AvailableForListIDsOptions = {
           videoPlaylistId: options.videoPlaylistId
         }
       })
+
+      query.subQuery = false
     }
 
     if (options.filter || options.accountId || options.videoChannelId) {