mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
server/server -> server/core
This commit is contained in:
parent
114327d4ce
commit
5a3d0650c9
838 changed files with 111 additions and 111 deletions
37
server/core/lib/transcoding/create-transcoding-job.ts
Normal file
37
server/core/lib/transcoding/create-transcoding-job.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
import { CONFIG } from '@server/initializers/config.js'
|
||||
import { MUserId, MVideoFile, MVideoFullLight } from '@server/types/models/index.js'
|
||||
import { TranscodingJobQueueBuilder, TranscodingRunnerJobBuilder } from './shared/index.js'
|
||||
|
||||
export function createOptimizeOrMergeAudioJobs (options: {
|
||||
video: MVideoFullLight
|
||||
videoFile: MVideoFile
|
||||
isNewVideo: boolean
|
||||
user: MUserId
|
||||
videoFileAlreadyLocked: boolean
|
||||
}) {
|
||||
return getJobBuilder().createOptimizeOrMergeAudioJobs(options)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export function createTranscodingJobs (options: {
|
||||
transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7
|
||||
video: MVideoFullLight
|
||||
resolutions: number[]
|
||||
isNewVideo: boolean
|
||||
user: MUserId
|
||||
}) {
|
||||
return getJobBuilder().createTranscodingJobs(options)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function getJobBuilder () {
|
||||
if (CONFIG.TRANSCODING.REMOTE_RUNNERS.ENABLED === true) {
|
||||
return new TranscodingRunnerJobBuilder()
|
||||
}
|
||||
|
||||
return new TranscodingJobQueueBuilder()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue