More robust test

pull/5817/head
Chocobozzz 2023-05-15 15:41:31 +02:00
parent 5a05c14573
commit 261dac403a
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 6 additions and 3 deletions

View File

@ -148,8 +148,6 @@ describe('Test users with multiple servers', function () {
})
it('Should search through account videos', async function () {
this.timeout(10_000)
const created = await servers[0].videos.upload({ token: userAccessToken, attributes: { name: 'Kami no chikara' } })
await waitJobs(servers)

View File

@ -14,7 +14,7 @@ export class StreamingPlaylistsCommand extends AbstractCommand {
withRetry?: boolean // default false
currentRetry?: number
}): Promise<string> {
const { videoFileToken, reinjectVideoFileToken, withRetry = false, currentRetry = 1 } = options
const { videoFileToken, reinjectVideoFileToken, expectedStatus, withRetry = false, currentRetry = 1 } = options
try {
const result = await unwrapTextOrDecode(this.getRawRequest({
@ -29,6 +29,11 @@ export class StreamingPlaylistsCommand extends AbstractCommand {
defaultExpectedStatus: HttpStatusCode.OK_200
}))
// master.m3u8 could be empty
if (!result && (!expectedStatus || expectedStatus === HttpStatusCode.OK_200)) {
throw new Error('Empty result')
}
return result
} catch (err) {
if (!withRetry || currentRetry > 10) throw err