mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 01:39:37 +02:00

* Implement processing storyboards by runners * Fixed storyboard generation by runners * use common code patterns * fix import * improve debug logging for storyboard generation * config option for storyboard processing with remote-runners * refactor repetitive pattern * refactor storyboard related code to share common utlities * Fix test * Fix storyboard generation config logic * Improve logging * Added tests for storyboard generation with runners * Refactor PR --------- Co-authored-by: ilfarpro <ilfarpro@ya.ru> Co-authored-by: Chocobozzz <me@florianbigard.com>
24 lines
1.5 KiB
TypeScript
24 lines
1.5 KiB
TypeScript
import { RunnerJobSuccessPayload, RunnerJobType, RunnerJobUpdatePayload } from '@peertube/peertube-models'
|
|
import { MRunnerJob } from '@server/types/models/runners/index.js'
|
|
import { AbstractJobHandler } from './abstract-job-handler.js'
|
|
import { LiveRTMPHLSTranscodingJobHandler } from './live-rtmp-hls-transcoding-job-handler.js'
|
|
import { TranscriptionJobHandler } from './transcription-job-handler.js'
|
|
import { VideoStudioTranscodingJobHandler } from './video-studio-transcoding-job-handler.js'
|
|
import { VODAudioMergeTranscodingJobHandler } from './vod-audio-merge-transcoding-job-handler.js'
|
|
import { VODHLSTranscodingJobHandler } from './vod-hls-transcoding-job-handler.js'
|
|
import { VODWebVideoTranscodingJobHandler } from './vod-web-video-transcoding-job-handler.js'
|
|
import { VideoStoryboardJobHandler } from './video-storyboard-job-handler.js'
|
|
|
|
const processors: Record<RunnerJobType, new() => AbstractJobHandler<unknown, RunnerJobUpdatePayload, RunnerJobSuccessPayload>> = {
|
|
'vod-web-video-transcoding': VODWebVideoTranscodingJobHandler,
|
|
'vod-hls-transcoding': VODHLSTranscodingJobHandler,
|
|
'vod-audio-merge-transcoding': VODAudioMergeTranscodingJobHandler,
|
|
'live-rtmp-hls-transcoding': LiveRTMPHLSTranscodingJobHandler,
|
|
'video-studio-transcoding': VideoStudioTranscodingJobHandler,
|
|
'video-transcription': TranscriptionJobHandler,
|
|
'generate-video-storyboard': VideoStoryboardJobHandler
|
|
}
|
|
|
|
export function getRunnerJobHandlerClass (job: MRunnerJob) {
|
|
return processors[job.type]
|
|
}
|