aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/live.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-19 14:30:00 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-02-19 16:29:00 +0100
commit94d721efdc9a8c2cda612f49506a41adb6a06f1d (patch)
treeb7f14d72b2a34471addf2d4476b777d373ed9c59 /shared/extra-utils/videos/live.ts
parentd7764e2eb7e2255a42465c8b06df9a77e3710d81 (diff)
downloadPeerTube-94d721efdc9a8c2cda612f49506a41adb6a06f1d.tar.gz
PeerTube-94d721efdc9a8c2cda612f49506a41adb6a06f1d.tar.zst
PeerTube-94d721efdc9a8c2cda612f49506a41adb6a06f1d.zip
Fix stats tests
Diffstat (limited to 'shared/extra-utils/videos/live.ts')
-rw-r--r--shared/extra-utils/videos/live.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts
index b0e499ce0..df7370008 100644
--- a/shared/extra-utils/videos/live.ts
+++ b/shared/extra-utils/videos/live.ts
@@ -164,6 +164,17 @@ async function waitUntilLiveState (url: string, token: string, videoId: number |
164 } while (video.state.id !== state) 164 } while (video.state.id !== state)
165} 165}
166 166
167async function waitUntilLiveSaved (url: string, token: string, videoId: number | string) {
168 let video: VideoDetails
169
170 do {
171 const res = await getVideoWithToken(url, token, videoId)
172 video = res.body
173
174 await wait(500)
175 } while (video.isLive === true && video.state.id !== VideoState.PUBLISHED)
176}
177
167async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resolutions: number[] = []) { 178async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resolutions: number[] = []) {
168 const basePath = buildServerDirectory(server, 'streaming-playlists') 179 const basePath = buildServerDirectory(server, 'streaming-playlists')
169 const hlsPath = join(basePath, 'hls', videoUUID) 180 const hlsPath = join(basePath, 'hls', videoUUID)
@@ -203,6 +214,7 @@ async function getPlaylistsCount (server: ServerInfo, videoUUID: string) {
203export { 214export {
204 getLive, 215 getLive,
205 getPlaylistsCount, 216 getPlaylistsCount,
217 waitUntilLiveSaved,
206 waitUntilLivePublished, 218 waitUntilLivePublished,
207 updateLive, 219 updateLive,
208 createLive, 220 createLive,