Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

More robust test

Chocobozzz261dac403a63
diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts
index f94191b043..8d94362479 100644
--- a/server/tests/api/users/users-multiple-servers.ts
+++ b/server/tests/api/users/users-multiple-servers.ts
@@ -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)
diff --git a/shared/server-commands/videos/streaming-playlists-command.ts b/shared/server-commands/videos/streaming-playlists-command.ts
index 87aacc5f69..b988ac4b2f 100644
--- a/shared/server-commands/videos/streaming-playlists-command.ts
+++ b/shared/server-commands/videos/streaming-playlists-command.ts
@@ -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