aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-11 17:10:53 +0200
committerChocobozzz <me@florianbigard.com>2022-10-11 17:14:54 +0200
commitdd84f4f2639cd67b8ff8c04423c59667d55180bf (patch)
treea5a583157735a05f8ebbae953c4deca8f328856d
parent5e1bd8690b740e10aa3a959eb3ecaf7a0aae87cf (diff)
downloadPeerTube-dd84f4f2639cd67b8ff8c04423c59667d55180bf.tar.gz
PeerTube-dd84f4f2639cd67b8ff8c04423c59667d55180bf.tar.zst
PeerTube-dd84f4f2639cd67b8ff8c04423c59667d55180bf.zip
Wait segment sha processing
-rw-r--r--server/tests/api/live/live.ts2
-rw-r--r--shared/server-commands/videos/live-command.ts9
2 files changed, 10 insertions, 1 deletions
diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts
index 0a7ae8536..3f2a304be 100644
--- a/server/tests/api/live/live.ts
+++ b/server/tests/api/live/live.ts
@@ -519,7 +519,7 @@ describe('Test live', function () {
519 } 519 }
520 520
521 const minBitrateLimits = { 521 const minBitrateLimits = {
522 720: 5000 * 1000, 522 720: 4800 * 1000,
523 360: 1000 * 1000, 523 360: 1000 * 1000,
524 240: 550 * 1000 524 240: 550 * 1000
525 } 525 }
diff --git a/shared/server-commands/videos/live-command.ts b/shared/server-commands/videos/live-command.ts
index a0e0c7c8f..b163f7189 100644
--- a/shared/server-commands/videos/live-command.ts
+++ b/shared/server-commands/videos/live-command.ts
@@ -186,6 +186,15 @@ export class LiveCommand extends AbstractCommand {
186 defaultExpectedStatus: HttpStatusCode.OK_200 186 defaultExpectedStatus: HttpStatusCode.OK_200
187 }) 187 })
188 188
189 const video = await server.videos.get({ id: videoUUID })
190 const hlsPlaylist = video.streamingPlaylists[0]
191
192 const shaBody = await server.streamingPlaylists.getSegmentSha256({ url: hlsPlaylist.segmentsSha256Url })
193
194 if (!shaBody[segmentName]) {
195 throw new Error('Segment SHA does not exist')
196 }
197
189 error = false 198 error = false
190 } catch { 199 } catch {
191 error = true 200 error = true