aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/server/job.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/models/server/job.model.ts')
-rw-r--r--shared/models/server/job.model.ts43
1 files changed, 35 insertions, 8 deletions
diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts
index 9c0b5ea56..16187d133 100644
--- a/shared/models/server/job.model.ts
+++ b/shared/models/server/job.model.ts
@@ -18,6 +18,7 @@ export type JobType =
18 | 'after-video-channel-import' 18 | 'after-video-channel-import'
19 | 'email' 19 | 'email'
20 | 'federate-video' 20 | 'federate-video'
21 | 'transcoding-job-builder'
21 | 'manage-video-torrent' 22 | 'manage-video-torrent'
22 | 'move-to-object-storage' 23 | 'move-to-object-storage'
23 | 'notify' 24 | 'notify'
@@ -41,6 +42,10 @@ export interface Job {
41 createdAt: Date | string 42 createdAt: Date | string
42 finishedOn: Date | string 43 finishedOn: Date | string
43 processedOn: Date | string 44 processedOn: Date | string
45
46 parent?: {
47 id: string
48 }
44} 49}
45 50
46export type ActivitypubHttpBroadcastPayload = { 51export type ActivitypubHttpBroadcastPayload = {
@@ -139,30 +144,28 @@ interface BaseTranscodingPayload {
139export interface HLSTranscodingPayload extends BaseTranscodingPayload { 144export interface HLSTranscodingPayload extends BaseTranscodingPayload {
140 type: 'new-resolution-to-hls' 145 type: 'new-resolution-to-hls'
141 resolution: VideoResolution 146 resolution: VideoResolution
147 fps: number
142 copyCodecs: boolean 148 copyCodecs: boolean
143 149
144 hasAudio: boolean 150 deleteWebTorrentFiles: boolean
145
146 autoDeleteWebTorrentIfNeeded: boolean
147 isMaxQuality: boolean
148} 151}
149 152
150export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload { 153export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload {
151 type: 'new-resolution-to-webtorrent' 154 type: 'new-resolution-to-webtorrent'
152 resolution: VideoResolution 155 resolution: VideoResolution
153 156 fps: number
154 hasAudio: boolean
155 createHLSIfNeeded: boolean
156} 157}
157 158
158export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload { 159export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
159 type: 'merge-audio-to-webtorrent' 160 type: 'merge-audio-to-webtorrent'
160 resolution: VideoResolution 161 resolution: VideoResolution
161 createHLSIfNeeded: true 162 fps: number
162} 163}
163 164
164export interface OptimizeTranscodingPayload extends BaseTranscodingPayload { 165export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
165 type: 'optimize-to-webtorrent' 166 type: 'optimize-to-webtorrent'
167
168 quickTranscode: boolean
166} 169}
167 170
168export type VideoTranscodingPayload = 171export type VideoTranscodingPayload =
@@ -258,3 +261,27 @@ export interface FederateVideoPayload {
258 videoUUID: string 261 videoUUID: string
259 isNewVideo: boolean 262 isNewVideo: boolean
260} 263}
264
265// ---------------------------------------------------------------------------
266
267export interface TranscodingJobBuilderPayload {
268 videoUUID: string
269
270 optimizeJob?: {
271 isNewVideo: boolean
272 }
273
274 // Array of jobs to create
275 jobs?: {
276 type: 'video-transcoding'
277 payload: VideoTranscodingPayload
278 priority?: number
279 }[]
280
281 // Array of sequential jobs to create
282 sequentialJobs?: {
283 type: 'video-transcoding'
284 payload: VideoTranscodingPayload
285 priority?: number
286 }[][]
287}