Support short uuid for scripts
This commit is contained in:
parent
66a7fc9473
commit
c186a67f90
4 changed files with 26 additions and 17 deletions
|
@ -8,7 +8,7 @@ import { JobQueue } from '../server/lib/job-queue'
|
|||
import { computeResolutionsToTranscode } from '@server/helpers/ffprobe-utils'
|
||||
import { VideoState, VideoTranscodingPayload } from '@shared/models'
|
||||
import { CONFIG } from '@server/initializers/config'
|
||||
import { isUUIDValid } from '@server/helpers/custom-validators/misc'
|
||||
import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc'
|
||||
import { addTranscodingJob } from '@server/lib/video'
|
||||
|
||||
program
|
||||
|
@ -39,12 +39,14 @@ run()
|
|||
async function run () {
|
||||
await initDatabaseModels(true)
|
||||
|
||||
if (isUUIDValid(options.video) === false) {
|
||||
const uuid = toCompleteUUID(options.video)
|
||||
|
||||
if (isUUIDValid(uuid) === false) {
|
||||
console.error('%s is not a valid video UUID.', options.video)
|
||||
return
|
||||
}
|
||||
|
||||
const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(options.video)
|
||||
const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(uuid)
|
||||
if (!video) throw new Error('Video not found.')
|
||||
|
||||
const dataInput: VideoTranscodingPayload[] = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue