diff options
author | Florent F <florent.fayolle69@gmail.com> | 2018-06-15 18:27:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-15 18:27:35 +0200 |
commit | 05623b9030e16449b21a55735fb0451276d61e14 (patch) | |
tree | 37fd3d4178582ccae1514fc98ab0717fc90b4f34 /scripts/create-transcoding-job.ts | |
parent | f3a2cf8d2f7329c0ac2123c0eb30bfe65d1e9b57 (diff) | |
download | PeerTube-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-x | scripts/create-transcoding-job.ts | 13 |
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 | ||
9 | program | 9 | program |
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 | ||
13 | if (program['video'] === undefined) { | 14 | if (program['video'] === undefined) { |
@@ -15,6 +16,11 @@ if (program['video'] === undefined) { | |||
15 | process.exit(-1) | 16 | process.exit(-1) |
16 | } | 17 | } |
17 | 18 | ||
19 | if (program.resolution !== undefined && Number.isNaN(+program.resolution)) { | ||
20 | console.error('The resolution must be an integer (example: 1080).') | ||
21 | process.exit(-1) | ||
22 | } | ||
23 | |||
18 | run() | 24 | run() |
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() |