Fix replay last segments loop

pull/3423/head
Chocobozzz 2020-12-07 10:00:34 +01:00
parent 2d53be0267
commit 5b9b403a20
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 12 deletions

View 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)