]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix replay last segments loop
authorChocobozzz <me@florianbigard.com>
Mon, 7 Dec 2020 09:00:34 +0000 (10:00 +0100)
committerChocobozzz <me@florianbigard.com>
Mon, 7 Dec 2020 15:07:00 +0000 (16:07 +0100)
server/lib/job-queue/handlers/video-live-ending.ts

index 6a675b0ef505e9c0850deda6306f4d363bb87a4c..93d925830055d7239e2bfdae80cbefdfffb9e472 100644 (file)
@@ -69,18 +69,9 @@ async function saveLive (video: MVideo, live: MVideoLive) {
 
   const rootFiles = await readdir(hlsDirectory)
 
-  const playlistFiles: string[] = []
-
-  for (const file of rootFiles) {
-    // Move remaining files in the replay directory
-    if (file.endsWith('.ts')) {
-      await LiveManager.Instance.addSegmentToReplay(hlsDirectory, join(hlsDirectory, file))
-    }
-
-    if (file.endsWith('.m3u8') && file !== 'master.m3u8') {
-      playlistFiles.push(file)
-    }
-  }
+  const playlistFiles = rootFiles.filter(file => {
+    return file.endsWith('.m3u8') && file !== 'master.m3u8'
+  })
 
   await cleanupLiveFiles(hlsDirectory)