aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands
diff options
context:
space:
mode:
Diffstat (limited to 'shared/server-commands')
-rw-r--r--shared/server-commands/videos/streaming-playlists-command.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/shared/server-commands/videos/streaming-playlists-command.ts b/shared/server-commands/videos/streaming-playlists-command.ts
index 87aacc5f6..b988ac4b2 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 {
14 withRetry?: boolean // default false 14 withRetry?: boolean // default false
15 currentRetry?: number 15 currentRetry?: number
16 }): Promise<string> { 16 }): Promise<string> {
17 const { videoFileToken, reinjectVideoFileToken, withRetry = false, currentRetry = 1 } = options 17 const { videoFileToken, reinjectVideoFileToken, expectedStatus, withRetry = false, currentRetry = 1 } = options
18 18
19 try { 19 try {
20 const result = await unwrapTextOrDecode(this.getRawRequest({ 20 const result = await unwrapTextOrDecode(this.getRawRequest({
@@ -29,6 +29,11 @@ export class StreamingPlaylistsCommand extends AbstractCommand {
29 defaultExpectedStatus: HttpStatusCode.OK_200 29 defaultExpectedStatus: HttpStatusCode.OK_200
30 })) 30 }))
31 31
32 // master.m3u8 could be empty
33 if (!result && (!expectedStatus || expectedStatus === HttpStatusCode.OK_200)) {
34 throw new Error('Empty result')
35 }
36
32 return result 37 return result
33 } catch (err) { 38 } catch (err) {
34 if (!withRetry || currentRetry > 10) throw err 39 if (!withRetry || currentRetry > 10) throw err