]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/lib/transcoding/create-transcoding-job.ts
Fix import video file lock
[github/Chocobozzz/PeerTube.git] / server / lib / transcoding / create-transcoding-job.ts
1 import { CONFIG } from '@server/initializers/config'
2 import { MUserId, MVideoFile, MVideoFullLight } from '@server/types/models'
3 import { TranscodingJobQueueBuilder, TranscodingRunnerJobBuilder } from './shared'
4
5 export function createOptimizeOrMergeAudioJobs (options: {
6 video: MVideoFullLight
7 videoFile: MVideoFile
8 isNewVideo: boolean
9 user: MUserId
10 videoFileAlreadyLocked: boolean
11 }) {
12 return getJobBuilder().createOptimizeOrMergeAudioJobs(options)
13 }
14
15 // ---------------------------------------------------------------------------
16
17 export function createTranscodingJobs (options: {
18 transcodingType: 'hls' | 'webtorrent'
19 video: MVideoFullLight
20 resolutions: number[]
21 isNewVideo: boolean
22 user: MUserId
23 }) {
24 return getJobBuilder().createTranscodingJobs(options)
25 }
26
27 // ---------------------------------------------------------------------------
28 // Private
29 // ---------------------------------------------------------------------------
30
31 function getJobBuilder () {
32 if (CONFIG.TRANSCODING.REMOTE_RUNNERS.ENABLED === true) {
33 return new TranscodingRunnerJobBuilder()
34 }
35
36 return new TranscodingJobQueueBuilder()
37 }