diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-19 14:30:00 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-02-19 16:29:00 +0100 |
commit | 94d721efdc9a8c2cda612f49506a41adb6a06f1d (patch) | |
tree | b7f14d72b2a34471addf2d4476b777d373ed9c59 /shared/extra-utils/videos/live.ts | |
parent | d7764e2eb7e2255a42465c8b06df9a77e3710d81 (diff) | |
download | PeerTube-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.ts | 12 |
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 | ||
167 | async 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 | |||
167 | async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resolutions: number[] = []) { | 178 | async 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) { | |||
203 | export { | 214 | export { |
204 | getLive, | 215 | getLive, |
205 | getPlaylistsCount, | 216 | getPlaylistsCount, |
217 | waitUntilLiveSaved, | ||
206 | waitUntilLivePublished, | 218 | waitUntilLivePublished, |
207 | updateLive, | 219 | updateLive, |
208 | createLive, | 220 | createLive, |