]> 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 a563f78ef01be25bd45fba268b64dfc9d9822052..7624b064904c63e83c382ab6e487aec776fe727f 100644 (file)
@@ -53,7 +53,7 @@ import {
   API_VERSION,
   CONFIG,
   CONSTRAINTS_FIELDS,
-  HLS_PLAYLIST_DIRECTORY,
+  HLS_STREAMING_PLAYLIST_DIRECTORY,
   HLS_REDUNDANCY_DIRECTORY,
   PREVIEWS_SIZE,
   REMOTE_SCHEME,
@@ -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) {
@@ -1751,7 +1756,7 @@ export class VideoModel extends Model<VideoModel> {
   }
 
   removeStreamingPlaylist (isRedundancy = false) {
-    const baseDir = isRedundancy ? HLS_REDUNDANCY_DIRECTORY : HLS_PLAYLIST_DIRECTORY
+    const baseDir = isRedundancy ? HLS_REDUNDANCY_DIRECTORY : HLS_STREAMING_PLAYLIST_DIRECTORY
 
     const filePath = join(baseDir, this.uuid)
     return remove(filePath)