From bb4ba6d94c5051fdd665ebe63fffcc105778b8be Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 3 Dec 2020 14:10:54 +0100 Subject: Add permanent live support --- shared/extra-utils/videos/live.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'shared/extra-utils/videos') diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts index 346134969..522beb8bc 100644 --- a/shared/extra-utils/videos/live.ts +++ b/shared/extra-utils/videos/live.ts @@ -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, -- cgit v1.2.3