diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-07 10:00:34 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-07 16:07:00 +0100 |
commit | 5b9b403a206e84342edfff536f0b30167976e80e (patch) | |
tree | 960b484bb18e2379a702d5cd1ea0770cca73199f /server/lib/job-queue/handlers/video-live-ending.ts | |
parent | 2d53be0267acc49cda46707b885096193a1f4e9c (diff) | |
download | PeerTube-5b9b403a206e84342edfff536f0b30167976e80e.tar.gz PeerTube-5b9b403a206e84342edfff536f0b30167976e80e.tar.zst PeerTube-5b9b403a206e84342edfff536f0b30167976e80e.zip |
Fix replay last segments loop
Diffstat (limited to 'server/lib/job-queue/handlers/video-live-ending.ts')
-rw-r--r-- | server/lib/job-queue/handlers/video-live-ending.ts | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts index 6a675b0ef..93d925830 100644 --- a/server/lib/job-queue/handlers/video-live-ending.ts +++ b/server/lib/job-queue/handlers/video-live-ending.ts | |||
@@ -69,18 +69,9 @@ async function saveLive (video: MVideo, live: MVideoLive) { | |||
69 | 69 | ||
70 | const rootFiles = await readdir(hlsDirectory) | 70 | const rootFiles = await readdir(hlsDirectory) |
71 | 71 | ||
72 | const playlistFiles: string[] = [] | 72 | const playlistFiles = rootFiles.filter(file => { |
73 | 73 | return file.endsWith('.m3u8') && file !== 'master.m3u8' | |
74 | for (const file of rootFiles) { | 74 | }) |
75 | // Move remaining files in the replay directory | ||
76 | if (file.endsWith('.ts')) { | ||
77 | await LiveManager.Instance.addSegmentToReplay(hlsDirectory, join(hlsDirectory, file)) | ||
78 | } | ||
79 | |||
80 | if (file.endsWith('.m3u8') && file !== 'master.m3u8') { | ||
81 | playlistFiles.push(file) | ||
82 | } | ||
83 | } | ||
84 | 75 | ||
85 | await cleanupLiveFiles(hlsDirectory) | 76 | await cleanupLiveFiles(hlsDirectory) |
86 | 77 | ||