diff options
Diffstat (limited to 'scripts')
-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() |