]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/lib/jobs/transcoding-job-scheduler/transcoding-job-scheduler.ts
Fix video upload and videos list
[github/Chocobozzz/PeerTube.git] / server / lib / jobs / transcoding-job-scheduler / transcoding-job-scheduler.ts
1 import { JobCategory } from '../../../../shared'
2 import { JobHandler, JobScheduler } from '../job-scheduler'
3 import * as videoFileOptimizer from './video-file-optimizer-handler'
4 import * as videoFileTranscoder from './video-file-transcoder-handler'
5 import { VideoInstance } from '../../../models/video/video-interface'
6
7 type TranscodingJobPayload = {
8 videoUUID: string
9 resolution?: number
10 }
11 const jobHandlers: { [ handlerName: string ]: JobHandler<TranscodingJobPayload, VideoInstance> } = {
12 videoFileOptimizer,
13 videoFileTranscoder
14 }
15 const jobCategory: JobCategory = 'transcoding'
16
17 const transcodingJobScheduler = new JobScheduler(jobCategory, jobHandlers)
18
19 export {
20 TranscodingJobPayload,
21 transcodingJobScheduler
22 }