aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/create-transcoding-job.ts
diff options
context:
space:
mode:
authorFlorent F <florent.fayolle69@gmail.com>2018-06-15 18:27:35 +0200
committerChocobozzz <me@florianbigard.com>2018-06-15 18:27:35 +0200
commit05623b9030e16449b21a55735fb0451276d61e14 (patch)
tree37fd3d4178582ccae1514fc98ab0717fc90b4f34 /scripts/create-transcoding-job.ts
parentf3a2cf8d2f7329c0ac2123c0eb30bfe65d1e9b57 (diff)
downloadPeerTube-05623b9030e16449b21a55735fb0451276d61e14.tar.gz
PeerTube-05623b9030e16449b21a55735fb0451276d61e14.tar.zst
PeerTube-05623b9030e16449b21a55735fb0451276d61e14.zip
Add resolution to create-transcoding-job script (#654)
* Add resolution to create-transcoding-job script * Requested changes
Diffstat (limited to 'scripts/create-transcoding-job.ts')
-rwxr-xr-xscripts/create-transcoding-job.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/create-transcoding-job.ts b/scripts/create-transcoding-job.ts
index 463cdfad3..179fb4fa6 100755
--- a/scripts/create-transcoding-job.ts
+++ b/scripts/create-transcoding-job.ts
@@ -8,6 +8,7 @@ import { JobQueue } from '../server/lib/job-queue'
8 8
9program 9program
10 .option('-v, --video [videoUUID]', 'Video UUID') 10 .option('-v, --video [videoUUID]', 'Video UUID')
11 .option('-r, --resolution [resolution]', 'Video resolution (integer)')
11 .parse(process.argv) 12 .parse(process.argv)
12 13
13if (program['video'] === undefined) { 14if (program['video'] === undefined) {
@@ -15,6 +16,11 @@ if (program['video'] === undefined) {
15 process.exit(-1) 16 process.exit(-1)
16} 17}
17 18
19if (program.resolution !== undefined && Number.isNaN(+program.resolution)) {
20 console.error('The resolution must be an integer (example: 1080).')
21 process.exit(-1)
22}
23
18run() 24run()
19 .then(() => process.exit(0)) 25 .then(() => process.exit(0))
20 .catch(err => { 26 .catch(err => {
@@ -30,7 +36,12 @@ async function run () {
30 36
31 const dataInput = { 37 const dataInput = {
32 videoUUID: video.uuid, 38 videoUUID: video.uuid,
33 isNewVideo: false 39 isNewVideo: false,
40 resolution: undefined
41 }
42
43 if (program.resolution !== undefined) {
44 dataInput.resolution = program.resolution
34 } 45 }
35 46
36 await JobQueue.Instance.init() 47 await JobQueue.Instance.init()