diff options
Diffstat (limited to 'server/lib/runners/job-handlers/runner-job-handlers.ts')
-rw-r--r-- | server/lib/runners/job-handlers/runner-job-handlers.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/lib/runners/job-handlers/runner-job-handlers.ts b/server/lib/runners/job-handlers/runner-job-handlers.ts new file mode 100644 index 000000000..7bad1bc77 --- /dev/null +++ b/server/lib/runners/job-handlers/runner-job-handlers.ts | |||
@@ -0,0 +1,18 @@ | |||
1 | import { MRunnerJob } from '@server/types/models/runners' | ||
2 | import { RunnerJobSuccessPayload, RunnerJobType, RunnerJobUpdatePayload } from '@shared/models' | ||
3 | import { AbstractJobHandler } from './abstract-job-handler' | ||
4 | import { LiveRTMPHLSTranscodingJobHandler } from './live-rtmp-hls-transcoding-job-handler' | ||
5 | import { VODAudioMergeTranscodingJobHandler } from './vod-audio-merge-transcoding-job-handler' | ||
6 | import { VODHLSTranscodingJobHandler } from './vod-hls-transcoding-job-handler' | ||
7 | import { VODWebVideoTranscodingJobHandler } from './vod-web-video-transcoding-job-handler' | ||
8 | |||
9 | const processors: Record<RunnerJobType, new() => AbstractJobHandler<unknown, RunnerJobUpdatePayload, RunnerJobSuccessPayload>> = { | ||
10 | 'vod-web-video-transcoding': VODWebVideoTranscodingJobHandler, | ||
11 | 'vod-hls-transcoding': VODHLSTranscodingJobHandler, | ||
12 | 'vod-audio-merge-transcoding': VODAudioMergeTranscodingJobHandler, | ||
13 | 'live-rtmp-hls-transcoding': LiveRTMPHLSTranscodingJobHandler | ||
14 | } | ||
15 | |||
16 | export function getRunnerJobHandlerClass (job: MRunnerJob) { | ||
17 | return processors[job.type] | ||
18 | } | ||