aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/create-transcoding-job.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-11 16:14:12 +0100
committerChocobozzz <me@florianbigard.com>2021-02-11 16:15:11 +0100
commit9aeef9aafa009762e128046bfb2f3cec3252e181 (patch)
tree300ed4599b2608cb5e848d85bc7ceccd17c90240 /scripts/create-transcoding-job.ts
parentc83af8f94a3c9732c3ea02c80fa96441e5d99c0f (diff)
downloadPeerTube-9aeef9aafa009762e128046bfb2f3cec3252e181.tar.gz
PeerTube-9aeef9aafa009762e128046bfb2f3cec3252e181.tar.zst
PeerTube-9aeef9aafa009762e128046bfb2f3cec3252e181.zip
Check video UUID in args scripts
Diffstat (limited to 'scripts/create-transcoding-job.ts')
-rwxr-xr-xscripts/create-transcoding-job.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/create-transcoding-job.ts b/scripts/create-transcoding-job.ts
index 9f1d8b956..56a5f4938 100755
--- a/scripts/create-transcoding-job.ts
+++ b/scripts/create-transcoding-job.ts
@@ -8,6 +8,7 @@ import { JobQueue } from '../server/lib/job-queue'
8import { computeResolutionsToTranscode } from '@server/helpers/ffprobe-utils' 8import { computeResolutionsToTranscode } from '@server/helpers/ffprobe-utils'
9import { VideoTranscodingPayload } from '@shared/models' 9import { VideoTranscodingPayload } from '@shared/models'
10import { CONFIG } from '@server/initializers/config' 10import { CONFIG } from '@server/initializers/config'
11import { isUUIDValid } from '@server/helpers/custom-validators/misc'
11 12
12program 13program
13 .option('-v, --video [videoUUID]', 'Video UUID') 14 .option('-v, --video [videoUUID]', 'Video UUID')
@@ -37,6 +38,11 @@ run()
37async function run () { 38async function run () {
38 await initDatabaseModels(true) 39 await initDatabaseModels(true)
39 40
41 if (isUUIDValid(options.video) === false) {
42 console.error('%s is not a valid video UUID.', options.video)
43 return
44 }
45
40 const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(options.video) 46 const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(options.video)
41 if (!video) throw new Error('Video not found.') 47 if (!video) throw new Error('Video not found.')
42 48