]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/lib/transcoding/create-transcoding-job.ts
Fix import video file lock
[github/Chocobozzz/PeerTube.git] / server / lib / transcoding / create-transcoding-job.ts
CommitLineData
0c9668f7
C
1import { CONFIG } from '@server/initializers/config'
2import { MUserId, MVideoFile, MVideoFullLight } from '@server/types/models'
3import { TranscodingJobQueueBuilder, TranscodingRunnerJobBuilder } from './shared'
4
5export function createOptimizeOrMergeAudioJobs (options: {
6 video: MVideoFullLight
7 videoFile: MVideoFile
8 isNewVideo: boolean
9 user: MUserId
9a3db678 10 videoFileAlreadyLocked: boolean
0c9668f7
C
11}) {
12 return getJobBuilder().createOptimizeOrMergeAudioJobs(options)
13}
14
15// ---------------------------------------------------------------------------
16
17export 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
31function getJobBuilder () {
32 if (CONFIG.TRANSCODING.REMOTE_RUNNERS.ENABLED === true) {
33 return new TranscodingRunnerJobBuilder()
34 }
35
36 return new TranscodingJobQueueBuilder()
37}