aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/videos')
-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,