diff options
Diffstat (limited to 'server/helpers/custom-validators/runners')
-rw-r--r-- | server/helpers/custom-validators/runners/jobs.ts | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/runners/jobs.ts b/server/helpers/custom-validators/runners/jobs.ts index 5f755d5bb..934bd37c9 100644 --- a/server/helpers/custom-validators/runners/jobs.ts +++ b/server/helpers/custom-validators/runners/jobs.ts | |||
@@ -6,6 +6,7 @@ import { | |||
6 | RunnerJobSuccessPayload, | 6 | RunnerJobSuccessPayload, |
7 | RunnerJobType, | 7 | RunnerJobType, |
8 | RunnerJobUpdatePayload, | 8 | RunnerJobUpdatePayload, |
9 | VideoEditionTranscodingSuccess, | ||
9 | VODAudioMergeTranscodingSuccess, | 10 | VODAudioMergeTranscodingSuccess, |
10 | VODHLSTranscodingSuccess, | 11 | VODHLSTranscodingSuccess, |
11 | VODWebVideoTranscodingSuccess | 12 | VODWebVideoTranscodingSuccess |
@@ -23,7 +24,8 @@ function isRunnerJobSuccessPayloadValid (value: RunnerJobSuccessPayload, type: R | |||
23 | return isRunnerJobVODWebVideoResultPayloadValid(value as VODWebVideoTranscodingSuccess, type, files) || | 24 | return isRunnerJobVODWebVideoResultPayloadValid(value as VODWebVideoTranscodingSuccess, type, files) || |
24 | isRunnerJobVODHLSResultPayloadValid(value as VODHLSTranscodingSuccess, type, files) || | 25 | isRunnerJobVODHLSResultPayloadValid(value as VODHLSTranscodingSuccess, type, files) || |
25 | isRunnerJobVODAudioMergeResultPayloadValid(value as VODHLSTranscodingSuccess, type, files) || | 26 | isRunnerJobVODAudioMergeResultPayloadValid(value as VODHLSTranscodingSuccess, type, files) || |
26 | isRunnerJobLiveRTMPHLSResultPayloadValid(value as LiveRTMPHLSTranscodingSuccess, type) | 27 | isRunnerJobLiveRTMPHLSResultPayloadValid(value as LiveRTMPHLSTranscodingSuccess, type) || |
28 | isRunnerJobVideoEditionResultPayloadValid(value as VideoEditionTranscodingSuccess, type, files) | ||
27 | } | 29 | } |
28 | 30 | ||
29 | // --------------------------------------------------------------------------- | 31 | // --------------------------------------------------------------------------- |
@@ -35,6 +37,7 @@ function isRunnerJobProgressValid (value: string) { | |||
35 | function isRunnerJobUpdatePayloadValid (value: RunnerJobUpdatePayload, type: RunnerJobType, files: UploadFilesForCheck) { | 37 | function isRunnerJobUpdatePayloadValid (value: RunnerJobUpdatePayload, type: RunnerJobType, files: UploadFilesForCheck) { |
36 | return isRunnerJobVODWebVideoUpdatePayloadValid(value, type, files) || | 38 | return isRunnerJobVODWebVideoUpdatePayloadValid(value, type, files) || |
37 | isRunnerJobVODHLSUpdatePayloadValid(value, type, files) || | 39 | isRunnerJobVODHLSUpdatePayloadValid(value, type, files) || |
40 | isRunnerJobVideoEditionUpdatePayloadValid(value, type, files) || | ||
38 | isRunnerJobVODAudioMergeUpdatePayloadValid(value, type, files) || | 41 | isRunnerJobVODAudioMergeUpdatePayloadValid(value, type, files) || |
39 | isRunnerJobLiveRTMPHLSUpdatePayloadValid(value, type, files) | 42 | isRunnerJobLiveRTMPHLSUpdatePayloadValid(value, type, files) |
40 | } | 43 | } |
@@ -102,6 +105,15 @@ function isRunnerJobLiveRTMPHLSResultPayloadValid ( | |||
102 | return type === 'live-rtmp-hls-transcoding' && (!value || (typeof value === 'object' && Object.keys(value).length === 0)) | 105 | return type === 'live-rtmp-hls-transcoding' && (!value || (typeof value === 'object' && Object.keys(value).length === 0)) |
103 | } | 106 | } |
104 | 107 | ||
108 | function isRunnerJobVideoEditionResultPayloadValid ( | ||
109 | _value: VideoEditionTranscodingSuccess, | ||
110 | type: RunnerJobType, | ||
111 | files: UploadFilesForCheck | ||
112 | ) { | ||
113 | return type === 'video-edition-transcoding' && | ||
114 | isFileValid({ files, field: 'payload[videoFile]', mimeTypeRegex: null, maxSize: null }) | ||
115 | } | ||
116 | |||
105 | // --------------------------------------------------------------------------- | 117 | // --------------------------------------------------------------------------- |
106 | 118 | ||
107 | function isRunnerJobVODWebVideoUpdatePayloadValid ( | 119 | function isRunnerJobVODWebVideoUpdatePayloadValid ( |
@@ -164,3 +176,12 @@ function isRunnerJobLiveRTMPHLSUpdatePayloadValid ( | |||
164 | ) | 176 | ) |
165 | ) | 177 | ) |
166 | } | 178 | } |
179 | |||
180 | function isRunnerJobVideoEditionUpdatePayloadValid ( | ||
181 | value: RunnerJobUpdatePayload, | ||
182 | type: RunnerJobType, | ||
183 | _files: UploadFilesForCheck | ||
184 | ) { | ||
185 | return type === 'video-edition-transcoding' && | ||
186 | (!value || (typeof value === 'object' && Object.keys(value).length === 0)) | ||
187 | } | ||