X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fvideos%2Flive.ts;h=df73700081cd8be3adbbf18caa9d380fc2788fe7;hb=5e7b5fc864e7598615dadc8130fae9d0f0f92241;hp=b0e499ce0be0a78f464282f4aa63b698e1f4943e;hpb=ba5a8d89bbf049e4afc41543bcc072cccdb02669;p=github%2FChocobozzz%2FPeerTube.git 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 | } while (video.state.id !== state) } +async function waitUntilLiveSaved (url: string, token: string, videoId: number | string) { + let video: VideoDetails + + do { + const res = await getVideoWithToken(url, token, videoId) + video = res.body + + await wait(500) + } while (video.isLive === true && video.state.id !== VideoState.PUBLISHED) +} + async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resolutions: number[] = []) { const basePath = buildServerDirectory(server, 'streaming-playlists') const hlsPath = join(basePath, 'hls', videoUUID) @@ -203,6 +214,7 @@ async function getPlaylistsCount (server: ServerInfo, videoUUID: string) { export { getLive, getPlaylistsCount, + waitUntilLiveSaved, waitUntilLivePublished, updateLive, createLive,