diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-03 14:10:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-03 15:21:16 +0100 |
commit | bb4ba6d94c5051fdd665ebe63fffcc105778b8be (patch) | |
tree | d39302608c53e31395683bb5dd551eac6ced89f8 /shared/extra-utils/videos | |
parent | 19b7ebfaa822b12f6da25ad2ba10398b3ef25ec6 (diff) | |
download | PeerTube-bb4ba6d94c5051fdd665ebe63fffcc105778b8be.tar.gz PeerTube-bb4ba6d94c5051fdd665ebe63fffcc105778b8be.tar.zst PeerTube-bb4ba6d94c5051fdd665ebe63fffcc105778b8be.zip |
Add permanent live support
Diffstat (limited to 'shared/extra-utils/videos')
-rw-r--r-- | shared/extra-utils/videos/live.ts | 10 |
1 files changed, 10 insertions, 0 deletions
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 | |||
177 | expect(files).to.contain('segments-sha256.json') | 177 | expect(files).to.contain('segments-sha256.json') |
178 | } | 178 | } |
179 | 179 | ||
180 | async function getPlaylistsCount (server: ServerInfo, videoUUID: string) { | ||
181 | const basePath = buildServerDirectory(server, 'streaming-playlists') | ||
182 | const hlsPath = join(basePath, 'hls', videoUUID) | ||
183 | |||
184 | const files = await readdir(hlsPath) | ||
185 | |||
186 | return files.filter(f => f.endsWith('.m3u8')).length | ||
187 | } | ||
188 | |||
180 | // --------------------------------------------------------------------------- | 189 | // --------------------------------------------------------------------------- |
181 | 190 | ||
182 | export { | 191 | export { |
183 | getLive, | 192 | getLive, |
193 | getPlaylistsCount, | ||
184 | waitUntilLivePublished, | 194 | waitUntilLivePublished, |
185 | updateLive, | 195 | updateLive, |
186 | waitUntilLiveStarts, | 196 | waitUntilLiveStarts, |