aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-24 15:22:56 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-11-25 10:07:51 +0100
commitca5c612bfdd225433bcc6ace01c8024df3f674ba (patch)
tree1b722cc346c9079c65338f0792ce7bcd2a20f8a0 /shared/extra-utils/videos/videos.ts
parent5a547f69d5dc5867e253f7721513479c754b4f15 (diff)
downloadPeerTube-ca5c612bfdd225433bcc6ace01c8024df3f674ba.tar.gz
PeerTube-ca5c612bfdd225433bcc6ace01c8024df3f674ba.tar.zst
PeerTube-ca5c612bfdd225433bcc6ace01c8024df3f674ba.zip
Add live transcoding bit rate tests
Diffstat (limited to 'shared/extra-utils/videos/videos.ts')
-rw-r--r--shared/extra-utils/videos/videos.ts15
1 files changed, 4 insertions, 11 deletions
diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.ts
index 29a646541..2b8c55acb 100644
--- a/shared/extra-utils/videos/videos.ts
+++ b/shared/extra-utils/videos/videos.ts
@@ -9,15 +9,7 @@ import { v4 as uuidv4 } from 'uuid'
9import validator from 'validator' 9import validator from 'validator'
10import { loadLanguages, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants' 10import { loadLanguages, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants'
11import { VideoDetails, VideoPrivacy } from '../../models/videos' 11import { VideoDetails, VideoPrivacy } from '../../models/videos'
12import { 12import { buildAbsoluteFixturePath, buildServerDirectory, dateIsValid, immutableAssign, testImage, webtorrentAdd } from '../miscs/miscs'
13 buildAbsoluteFixturePath,
14 buildServerDirectory,
15 dateIsValid,
16 immutableAssign,
17 root,
18 testImage,
19 webtorrentAdd
20} from '../miscs/miscs'
21import { makeGetRequest, makePutBodyRequest, makeUploadRequest } from '../requests/requests' 13import { makeGetRequest, makePutBodyRequest, makeUploadRequest } from '../requests/requests'
22import { waitJobs } from '../server/jobs' 14import { waitJobs } from '../server/jobs'
23import { ServerInfo } from '../server/servers' 15import { ServerInfo } from '../server/servers'
@@ -335,7 +327,7 @@ async function checkVideoFilesWereRemoved (
335 ] 327 ]
336) { 328) {
337 for (const directory of directories) { 329 for (const directory of directories) {
338 const directoryPath = buildServerDirectory(serverNumber, directory) 330 const directoryPath = buildServerDirectory({ internalServerNumber: serverNumber }, directory)
339 331
340 const directoryExists = await pathExists(directoryPath) 332 const directoryExists = await pathExists(directoryPath)
341 if (directoryExists === false) continue 333 if (directoryExists === false) continue
@@ -489,7 +481,8 @@ function rateVideo (url: string, accessToken: string, id: number, rating: string
489function parseTorrentVideo (server: ServerInfo, videoUUID: string, resolution: number) { 481function parseTorrentVideo (server: ServerInfo, videoUUID: string, resolution: number) {
490 return new Promise<any>((res, rej) => { 482 return new Promise<any>((res, rej) => {
491 const torrentName = videoUUID + '-' + resolution + '.torrent' 483 const torrentName = videoUUID + '-' + resolution + '.torrent'
492 const torrentPath = join(root(), 'test' + server.internalServerNumber, 'torrents', torrentName) 484 const torrentPath = buildServerDirectory(server, join('torrents', torrentName))
485
493 readFile(torrentPath, (err, data) => { 486 readFile(torrentPath, (err, data) => {
494 if (err) return rej(err) 487 if (err) return rej(err)
495 488