From 764b1a14fc494f2cfd7ea590d2f07b01df65c7ad Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 23 Jul 2021 11:20:00 +0200 Subject: Use random names for VOD HLS playlists --- shared/extra-utils/videos/live.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'shared/extra-utils/videos/live.ts') diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts index 502964b1a..94f5f5b59 100644 --- a/shared/extra-utils/videos/live.ts +++ b/shared/extra-utils/videos/live.ts @@ -76,7 +76,7 @@ async function waitUntilLivePublishedOnAllServers (servers: PeerTubeServer[], vi } } -async function checkLiveCleanup (server: PeerTubeServer, videoUUID: string, resolutions: number[] = []) { +async function checkLiveCleanupAfterSave (server: PeerTubeServer, videoUUID: string, resolutions: number[] = []) { const basePath = server.servers.buildDirectory('streaming-playlists') const hlsPath = join(basePath, 'hls', videoUUID) @@ -93,12 +93,18 @@ async function checkLiveCleanup (server: PeerTubeServer, videoUUID: string, reso expect(files).to.have.lengthOf(resolutions.length * 2 + 2) for (const resolution of resolutions) { - expect(files).to.contain(`${videoUUID}-${resolution}-fragmented.mp4`) - expect(files).to.contain(`${resolution}.m3u8`) + const fragmentedFile = files.find(f => f.endsWith(`-${resolution}-fragmented.mp4`)) + expect(fragmentedFile).to.exist + + const playlistFile = files.find(f => f.endsWith(`${resolution}.m3u8`)) + expect(playlistFile).to.exist } - expect(files).to.contain('master.m3u8') - expect(files).to.contain('segments-sha256.json') + const masterPlaylistFile = files.find(f => f.endsWith('-master.m3u8')) + expect(masterPlaylistFile).to.exist + + const shaFile = files.find(f => f.endsWith('-segments-sha256.json')) + expect(shaFile).to.exist } export { @@ -107,5 +113,5 @@ export { testFfmpegStreamError, stopFfmpeg, waitUntilLivePublishedOnAllServers, - checkLiveCleanup + checkLiveCleanupAfterSave } -- cgit v1.2.3