X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fcreate-transcoding-job.ts;h=ca9e2a99ab3e41c91d345a687aec3cba4683ab55;hb=89613cb444b4e1601d202153d0ec8635392ec872;hp=fec58da2ee667007c2388af7d275a293011c8911;hpb=a3b7421abb4192e215aa280418b62e96958c5e42;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/create-transcoding-job.ts b/scripts/create-transcoding-job.ts index fec58da2e..ca9e2a99a 100755 --- a/scripts/create-transcoding-job.ts +++ b/scripts/create-transcoding-job.ts @@ -3,10 +3,10 @@ registerTSPaths() import * as program from 'commander' import { VideoModel } from '../server/models/video/video' -import { initDatabaseModels } from '../server/initializers' +import { initDatabaseModels } from '../server/initializers/database' import { JobQueue } from '../server/lib/job-queue' -import { VideoTranscodingPayload } from '../server/lib/job-queue/handlers/video-transcoding' -import { computeResolutionsToTranscode } from '@server/helpers/ffmpeg-utils' +import { computeResolutionsToTranscode } from '@server/helpers/ffprobe-utils' +import { VideoTranscodingPayload } from '@shared/models' program .option('-v, --video [videoUUID]', 'Video UUID') @@ -43,11 +43,11 @@ async function run () { if (program.generateHls) { const resolutionsEnabled = program.resolution ? [ program.resolution ] - : computeResolutionsToTranscode(videoFileResolution).concat([ videoFileResolution ]) + : computeResolutionsToTranscode(videoFileResolution, 'vod').concat([ videoFileResolution ]) for (const resolution of resolutionsEnabled) { dataInput.push({ - type: 'hls', + type: 'new-resolution-to-hls', videoUUID: video.uuid, resolution, isPortraitMode: false, @@ -56,14 +56,14 @@ async function run () { } } else if (program.resolution !== undefined) { dataInput.push({ - type: 'new-resolution' as 'new-resolution', + type: 'new-resolution-to-webtorrent', videoUUID: video.uuid, isNewVideo: false, resolution: program.resolution }) } else { dataInput.push({ - type: 'optimize' as 'optimize', + type: 'optimize-to-webtorrent', videoUUID: video.uuid, isNewVideo: false })