Add permanent live support

This commit is contained in:
Chocobozzz
2020-12-03 14:10:54 +01:00
parent 19b7ebfaa8
commit bb4ba6d94c
25 changed files with 392 additions and 28 deletions

View File

@@ -177,10 +177,20 @@ async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resoluti
expect(files).to.contain('segments-sha256.json')
}
async function getPlaylistsCount (server: ServerInfo, videoUUID: string) {
const basePath = buildServerDirectory(server, 'streaming-playlists')
const hlsPath = join(basePath, 'hls', videoUUID)
const files = await readdir(hlsPath)
return files.filter(f => f.endsWith('.m3u8')).length
}
// ---------------------------------------------------------------------------
export {
getLive,
getPlaylistsCount,
waitUntilLivePublished,
updateLive,
waitUntilLiveStarts,