aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/runners/job-handlers
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/runners/job-handlers')
-rw-r--r--server/lib/runners/job-handlers/abstract-job-handler.ts10
-rw-r--r--server/lib/runners/job-handlers/index.ts2
-rw-r--r--server/lib/runners/job-handlers/runner-job-handlers.ts4
-rw-r--r--server/lib/runners/job-handlers/video-studio-transcoding-job-handler.ts (renamed from server/lib/runners/job-handlers/video-edition-transcoding-job-handler.ts)24
4 files changed, 20 insertions, 20 deletions
diff --git a/server/lib/runners/job-handlers/abstract-job-handler.ts b/server/lib/runners/job-handlers/abstract-job-handler.ts
index 76fd1c5ac..28c3e1eda 100644
--- a/server/lib/runners/job-handlers/abstract-job-handler.ts
+++ b/server/lib/runners/job-handlers/abstract-job-handler.ts
@@ -15,8 +15,8 @@ import {
15 RunnerJobSuccessPayload, 15 RunnerJobSuccessPayload,
16 RunnerJobType, 16 RunnerJobType,
17 RunnerJobUpdatePayload, 17 RunnerJobUpdatePayload,
18 RunnerJobVideoEditionTranscodingPayload, 18 RunnerJobStudioTranscodingPayload,
19 RunnerJobVideoEditionTranscodingPrivatePayload, 19 RunnerJobVideoStudioTranscodingPrivatePayload,
20 RunnerJobVODAudioMergeTranscodingPayload, 20 RunnerJobVODAudioMergeTranscodingPayload,
21 RunnerJobVODAudioMergeTranscodingPrivatePayload, 21 RunnerJobVODAudioMergeTranscodingPrivatePayload,
22 RunnerJobVODHLSTranscodingPayload, 22 RunnerJobVODHLSTranscodingPayload,
@@ -47,9 +47,9 @@ type CreateRunnerJobArg =
47 privatePayload: RunnerJobLiveRTMPHLSTranscodingPrivatePayload 47 privatePayload: RunnerJobLiveRTMPHLSTranscodingPrivatePayload
48 } | 48 } |
49 { 49 {
50 type: Extract<RunnerJobType, 'video-edition-transcoding'> 50 type: Extract<RunnerJobType, 'video-studio-transcoding'>
51 payload: RunnerJobVideoEditionTranscodingPayload 51 payload: RunnerJobStudioTranscodingPayload
52 privatePayload: RunnerJobVideoEditionTranscodingPrivatePayload 52 privatePayload: RunnerJobVideoStudioTranscodingPrivatePayload
53 } 53 }
54 54
55export abstract class AbstractJobHandler <C, U extends RunnerJobUpdatePayload, S extends RunnerJobSuccessPayload> { 55export abstract class AbstractJobHandler <C, U extends RunnerJobUpdatePayload, S extends RunnerJobSuccessPayload> {
diff --git a/server/lib/runners/job-handlers/index.ts b/server/lib/runners/job-handlers/index.ts
index a40cee865..40ad2f97a 100644
--- a/server/lib/runners/job-handlers/index.ts
+++ b/server/lib/runners/job-handlers/index.ts
@@ -1,7 +1,7 @@
1export * from './abstract-job-handler' 1export * from './abstract-job-handler'
2export * from './live-rtmp-hls-transcoding-job-handler' 2export * from './live-rtmp-hls-transcoding-job-handler'
3export * from './runner-job-handlers' 3export * from './runner-job-handlers'
4export * from './video-edition-transcoding-job-handler' 4export * from './video-studio-transcoding-job-handler'
5export * from './vod-audio-merge-transcoding-job-handler' 5export * from './vod-audio-merge-transcoding-job-handler'
6export * from './vod-hls-transcoding-job-handler' 6export * from './vod-hls-transcoding-job-handler'
7export * from './vod-web-video-transcoding-job-handler' 7export * from './vod-web-video-transcoding-job-handler'
diff --git a/server/lib/runners/job-handlers/runner-job-handlers.ts b/server/lib/runners/job-handlers/runner-job-handlers.ts
index 4ea6684ea..85551c365 100644
--- a/server/lib/runners/job-handlers/runner-job-handlers.ts
+++ b/server/lib/runners/job-handlers/runner-job-handlers.ts
@@ -2,7 +2,7 @@ import { MRunnerJob } from '@server/types/models/runners'
2import { RunnerJobSuccessPayload, RunnerJobType, RunnerJobUpdatePayload } from '@shared/models' 2import { RunnerJobSuccessPayload, RunnerJobType, RunnerJobUpdatePayload } from '@shared/models'
3import { AbstractJobHandler } from './abstract-job-handler' 3import { AbstractJobHandler } from './abstract-job-handler'
4import { LiveRTMPHLSTranscodingJobHandler } from './live-rtmp-hls-transcoding-job-handler' 4import { LiveRTMPHLSTranscodingJobHandler } from './live-rtmp-hls-transcoding-job-handler'
5import { VideoEditionTranscodingJobHandler } from './video-edition-transcoding-job-handler' 5import { VideoStudioTranscodingJobHandler } from './video-studio-transcoding-job-handler'
6import { VODAudioMergeTranscodingJobHandler } from './vod-audio-merge-transcoding-job-handler' 6import { VODAudioMergeTranscodingJobHandler } from './vod-audio-merge-transcoding-job-handler'
7import { VODHLSTranscodingJobHandler } from './vod-hls-transcoding-job-handler' 7import { VODHLSTranscodingJobHandler } from './vod-hls-transcoding-job-handler'
8import { VODWebVideoTranscodingJobHandler } from './vod-web-video-transcoding-job-handler' 8import { VODWebVideoTranscodingJobHandler } from './vod-web-video-transcoding-job-handler'
@@ -12,7 +12,7 @@ const processors: Record<RunnerJobType, new() => AbstractJobHandler<unknown, Run
12 'vod-hls-transcoding': VODHLSTranscodingJobHandler, 12 'vod-hls-transcoding': VODHLSTranscodingJobHandler,
13 'vod-audio-merge-transcoding': VODAudioMergeTranscodingJobHandler, 13 'vod-audio-merge-transcoding': VODAudioMergeTranscodingJobHandler,
14 'live-rtmp-hls-transcoding': LiveRTMPHLSTranscodingJobHandler, 14 'live-rtmp-hls-transcoding': LiveRTMPHLSTranscodingJobHandler,
15 'video-edition-transcoding': VideoEditionTranscodingJobHandler 15 'video-studio-transcoding': VideoStudioTranscodingJobHandler
16} 16}
17 17
18export function getRunnerJobHandlerClass (job: MRunnerJob) { 18export function getRunnerJobHandlerClass (job: MRunnerJob) {
diff --git a/server/lib/runners/job-handlers/video-edition-transcoding-job-handler.ts b/server/lib/runners/job-handlers/video-studio-transcoding-job-handler.ts
index 39a755c48..f604382b7 100644
--- a/server/lib/runners/job-handlers/video-edition-transcoding-job-handler.ts
+++ b/server/lib/runners/job-handlers/video-studio-transcoding-job-handler.ts
@@ -1,7 +1,7 @@
1 1
2import { basename } from 'path' 2import { basename } from 'path'
3import { logger } from '@server/helpers/logger' 3import { logger } from '@server/helpers/logger'
4import { onVideoEditionEnded, safeCleanupStudioTMPFiles } from '@server/lib/video-studio' 4import { onVideoStudioEnded, safeCleanupStudioTMPFiles } from '@server/lib/video-studio'
5import { MVideo } from '@server/types/models' 5import { MVideo } from '@server/types/models'
6import { MRunnerJob } from '@server/types/models/runners' 6import { MRunnerJob } from '@server/types/models/runners'
7import { buildUUID } from '@shared/extra-utils' 7import { buildUUID } from '@shared/extra-utils'
@@ -11,9 +11,9 @@ import {
11 isVideoStudioTaskWatermark, 11 isVideoStudioTaskWatermark,
12 RunnerJobState, 12 RunnerJobState,
13 RunnerJobUpdatePayload, 13 RunnerJobUpdatePayload,
14 RunnerJobVideoEditionTranscodingPayload, 14 RunnerJobStudioTranscodingPayload,
15 RunnerJobVideoEditionTranscodingPrivatePayload, 15 RunnerJobVideoStudioTranscodingPrivatePayload,
16 VideoEditionTranscodingSuccess, 16 VideoStudioTranscodingSuccess,
17 VideoState, 17 VideoState,
18 VideoStudioTaskPayload 18 VideoStudioTaskPayload
19} from '@shared/models' 19} from '@shared/models'
@@ -28,13 +28,13 @@ type CreateOptions = {
28} 28}
29 29
30// eslint-disable-next-line max-len 30// eslint-disable-next-line max-len
31export class VideoEditionTranscodingJobHandler extends AbstractJobHandler<CreateOptions, RunnerJobUpdatePayload, VideoEditionTranscodingSuccess> { 31export class VideoStudioTranscodingJobHandler extends AbstractJobHandler<CreateOptions, RunnerJobUpdatePayload, VideoStudioTranscodingSuccess> {
32 32
33 async create (options: CreateOptions) { 33 async create (options: CreateOptions) {
34 const { video, priority, tasks } = options 34 const { video, priority, tasks } = options
35 35
36 const jobUUID = buildUUID() 36 const jobUUID = buildUUID()
37 const payload: RunnerJobVideoEditionTranscodingPayload = { 37 const payload: RunnerJobStudioTranscodingPayload = {
38 input: { 38 input: {
39 videoFileUrl: generateRunnerTranscodingVideoInputFileUrl(jobUUID, video.uuid) 39 videoFileUrl: generateRunnerTranscodingVideoInputFileUrl(jobUUID, video.uuid)
40 }, 40 },
@@ -67,13 +67,13 @@ export class VideoEditionTranscodingJobHandler extends AbstractJobHandler<Create
67 }) 67 })
68 } 68 }
69 69
70 const privatePayload: RunnerJobVideoEditionTranscodingPrivatePayload = { 70 const privatePayload: RunnerJobVideoStudioTranscodingPrivatePayload = {
71 videoUUID: video.uuid, 71 videoUUID: video.uuid,
72 originalTasks: tasks 72 originalTasks: tasks
73 } 73 }
74 74
75 const job = await this.createRunnerJob({ 75 const job = await this.createRunnerJob({
76 type: 'video-edition-transcoding', 76 type: 'video-studio-transcoding',
77 jobUUID, 77 jobUUID,
78 payload, 78 payload,
79 privatePayload, 79 privatePayload,
@@ -103,10 +103,10 @@ export class VideoEditionTranscodingJobHandler extends AbstractJobHandler<Create
103 103
104 protected async specificComplete (options: { 104 protected async specificComplete (options: {
105 runnerJob: MRunnerJob 105 runnerJob: MRunnerJob
106 resultPayload: VideoEditionTranscodingSuccess 106 resultPayload: VideoStudioTranscodingSuccess
107 }) { 107 }) {
108 const { runnerJob, resultPayload } = options 108 const { runnerJob, resultPayload } = options
109 const privatePayload = runnerJob.privatePayload as RunnerJobVideoEditionTranscodingPrivatePayload 109 const privatePayload = runnerJob.privatePayload as RunnerJobVideoStudioTranscodingPrivatePayload
110 110
111 const video = await loadTranscodingRunnerVideo(runnerJob, this.lTags) 111 const video = await loadTranscodingRunnerVideo(runnerJob, this.lTags)
112 if (!video) { 112 if (!video) {
@@ -116,7 +116,7 @@ export class VideoEditionTranscodingJobHandler extends AbstractJobHandler<Create
116 116
117 const videoFilePath = resultPayload.videoFile as string 117 const videoFilePath = resultPayload.videoFile as string
118 118
119 await onVideoEditionEnded({ video, editionResultPath: videoFilePath, tasks: privatePayload.originalTasks }) 119 await onVideoStudioEnded({ video, editionResultPath: videoFilePath, tasks: privatePayload.originalTasks })
120 120
121 logger.info( 121 logger.info(
122 'Runner video edition transcoding job %s for %s ended.', 122 'Runner video edition transcoding job %s for %s ended.',
@@ -146,7 +146,7 @@ export class VideoEditionTranscodingJobHandler extends AbstractJobHandler<Create
146 }) { 146 }) {
147 const { runnerJob } = options 147 const { runnerJob } = options
148 148
149 const payload = runnerJob.privatePayload as RunnerJobVideoEditionTranscodingPrivatePayload 149 const payload = runnerJob.privatePayload as RunnerJobVideoStudioTranscodingPrivatePayload
150 await safeCleanupStudioTMPFiles(payload.originalTasks) 150 await safeCleanupStudioTMPFiles(payload.originalTasks)
151 151
152 const video = await loadTranscodingRunnerVideo(options.runnerJob, this.lTags) 152 const video = await loadTranscodingRunnerVideo(options.runnerJob, this.lTags)