diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-22 14:28:03 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-07-26 11:29:31 +0200 |
commit | 83903cb65d531a6b6b91715387493ba8312b264d (patch) | |
tree | fd172e26a483331e74f15a062743a9d40d4016d3 /server/tests/api/videos/audio-only.ts | |
parent | c4fa01f7c45b66b112ebd08abce744b7c4041feb (diff) | |
download | PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.tar.gz PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.tar.zst PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.zip |
Generate random uuid for video files
Diffstat (limited to 'server/tests/api/videos/audio-only.ts')
-rw-r--r-- | server/tests/api/videos/audio-only.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/server/tests/api/videos/audio-only.ts b/server/tests/api/videos/audio-only.ts index 15c3ae6d6..7fac6e738 100644 --- a/server/tests/api/videos/audio-only.ts +++ b/server/tests/api/videos/audio-only.ts | |||
@@ -2,7 +2,6 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { join } from 'path' | ||
6 | import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils' | 5 | import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils' |
7 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' | 6 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' |
8 | 7 | ||
@@ -11,6 +10,8 @@ const expect = chai.expect | |||
11 | describe('Test audio only video transcoding', function () { | 10 | describe('Test audio only video transcoding', function () { |
12 | let servers: PeerTubeServer[] = [] | 11 | let servers: PeerTubeServer[] = [] |
13 | let videoUUID: string | 12 | let videoUUID: string |
13 | let webtorrentAudioFileUrl: string | ||
14 | let fragmentedAudioFileUrl: string | ||
14 | 15 | ||
15 | before(async function () { | 16 | before(async function () { |
16 | this.timeout(120000) | 17 | this.timeout(120000) |
@@ -63,13 +64,18 @@ describe('Test audio only video transcoding', function () { | |||
63 | expect(files[1].resolution.id).to.equal(240) | 64 | expect(files[1].resolution.id).to.equal(240) |
64 | expect(files[2].resolution.id).to.equal(0) | 65 | expect(files[2].resolution.id).to.equal(0) |
65 | } | 66 | } |
67 | |||
68 | if (server.serverNumber === 1) { | ||
69 | webtorrentAudioFileUrl = video.files[2].fileUrl | ||
70 | fragmentedAudioFileUrl = video.streamingPlaylists[0].files[2].fileUrl | ||
71 | } | ||
66 | } | 72 | } |
67 | }) | 73 | }) |
68 | 74 | ||
69 | it('0p transcoded video should not have video', async function () { | 75 | it('0p transcoded video should not have video', async function () { |
70 | const paths = [ | 76 | const paths = [ |
71 | servers[0].servers.buildDirectory(join('videos', videoUUID + '-0.mp4')), | 77 | servers[0].servers.buildWebTorrentFilePath(webtorrentAudioFileUrl), |
72 | servers[0].servers.buildDirectory(join('streaming-playlists', 'hls', videoUUID, videoUUID + '-0-fragmented.mp4')) | 78 | servers[0].servers.buildFragmentedFilePath(videoUUID, fragmentedAudioFileUrl) |
73 | ] | 79 | ] |
74 | 80 | ||
75 | for (const path of paths) { | 81 | for (const path of paths) { |