diff options
author | Chocobozzz <me@florianbigard.com> | 2022-04-21 09:06:52 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-04-21 11:47:57 +0200 |
commit | 4ec52d04dcc5d664612331f8e08d7d90da990415 (patch) | |
tree | 4b193f9f8f210caaf2dbe05ef3e37fa3a6fc28f0 /server/tests/shared/live.ts | |
parent | 2024a3b9338d667640aa115da6071ea83d088c50 (diff) | |
download | PeerTube-4ec52d04dcc5d664612331f8e08d7d90da990415.tar.gz PeerTube-4ec52d04dcc5d664612331f8e08d7d90da990415.tar.zst PeerTube-4ec52d04dcc5d664612331f8e08d7d90da990415.zip |
Add ability to save replay of permanent lives
Diffstat (limited to 'server/tests/shared/live.ts')
-rw-r--r-- | server/tests/shared/live.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/tests/shared/live.ts b/server/tests/shared/live.ts index 72e3e27f6..6ee4899b0 100644 --- a/server/tests/shared/live.ts +++ b/server/tests/shared/live.ts | |||
@@ -5,11 +5,11 @@ import { pathExists, readdir } from 'fs-extra' | |||
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { PeerTubeServer } from '@shared/server-commands' | 6 | import { PeerTubeServer } from '@shared/server-commands' |
7 | 7 | ||
8 | async function checkLiveCleanupAfterSave (server: PeerTubeServer, videoUUID: string, resolutions: number[] = []) { | 8 | async function checkLiveCleanup (server: PeerTubeServer, videoUUID: string, savedResolutions: number[] = []) { |
9 | const basePath = server.servers.buildDirectory('streaming-playlists') | 9 | const basePath = server.servers.buildDirectory('streaming-playlists') |
10 | const hlsPath = join(basePath, 'hls', videoUUID) | 10 | const hlsPath = join(basePath, 'hls', videoUUID) |
11 | 11 | ||
12 | if (resolutions.length === 0) { | 12 | if (savedResolutions.length === 0) { |
13 | const result = await pathExists(hlsPath) | 13 | const result = await pathExists(hlsPath) |
14 | expect(result).to.be.false | 14 | expect(result).to.be.false |
15 | 15 | ||
@@ -19,9 +19,9 @@ async function checkLiveCleanupAfterSave (server: PeerTubeServer, videoUUID: str | |||
19 | const files = await readdir(hlsPath) | 19 | const files = await readdir(hlsPath) |
20 | 20 | ||
21 | // fragmented file and playlist per resolution + master playlist + segments sha256 json file | 21 | // fragmented file and playlist per resolution + master playlist + segments sha256 json file |
22 | expect(files).to.have.lengthOf(resolutions.length * 2 + 2) | 22 | expect(files).to.have.lengthOf(savedResolutions.length * 2 + 2) |
23 | 23 | ||
24 | for (const resolution of resolutions) { | 24 | for (const resolution of savedResolutions) { |
25 | const fragmentedFile = files.find(f => f.endsWith(`-${resolution}-fragmented.mp4`)) | 25 | const fragmentedFile = files.find(f => f.endsWith(`-${resolution}-fragmented.mp4`)) |
26 | expect(fragmentedFile).to.exist | 26 | expect(fragmentedFile).to.exist |
27 | 27 | ||
@@ -37,5 +37,5 @@ async function checkLiveCleanupAfterSave (server: PeerTubeServer, videoUUID: str | |||
37 | } | 37 | } |
38 | 38 | ||
39 | export { | 39 | export { |
40 | checkLiveCleanupAfterSave | 40 | checkLiveCleanup |
41 | } | 41 | } |