]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/cli/create-transcoding-job.ts
Fix HLS re transcoding with object storage enabled
[github/Chocobozzz/PeerTube.git] / server / tests / cli / create-transcoding-job.ts
index c85130fef8db2ea17c2e71f9837a5fd67804f9ce..b90e9bde90d1c50d5868e445aa1f8c0c28752d6a 100644 (file)
@@ -14,7 +14,7 @@ import {
   setAccessTokensToServers,
   waitJobs
 } from '@shared/server-commands'
-import { expectStartWith } from '../shared'
+import { checkResolutionsInMasterPlaylist, expectStartWith } from '../shared'
 
 const expect = chai.expect
 
@@ -163,11 +163,18 @@ function runTests (objectStorage: boolean) {
 
       expect(videoDetails.streamingPlaylists).to.have.lengthOf(1)
 
-      const files = videoDetails.streamingPlaylists[0].files
+      const hlsPlaylist = videoDetails.streamingPlaylists[0]
+
+      const files = hlsPlaylist.files
       expect(files).to.have.lengthOf(1)
       expect(files[0].resolution.id).to.equal(480)
 
-      if (objectStorage) await checkFilesInObjectStorage(files, 'playlist')
+      if (objectStorage) {
+        await checkFilesInObjectStorage(files, 'playlist')
+
+        const resolutions = files.map(f => f.resolution.id)
+        await checkResolutionsInMasterPlaylist({ server, playlistUrl: hlsPlaylist.playlistUrl, resolutions })
+      }
     }
   })