]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/server/job.model.ts
Use bullmq job dependency
[github/Chocobozzz/PeerTube.git] / shared / models / server / job.model.ts
index 9370cf011caedc0bbda00f887259438585c7e9ff..8c8f64de9a9dc082e927af171720f0ed0678b9b5 100644 (file)
@@ -1,14 +1,15 @@
 import { ContextType } from '../activitypub/context'
 import { VideoState } from '../videos'
-import { VideoStudioTaskCut } from '../videos/studio'
 import { VideoResolution } from '../videos/file/video-resolution.enum'
+import { VideoStudioTaskCut } from '../videos/studio'
 import { SendEmailOptions } from './emailer.model'
 
-export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused'
+export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused' | 'waiting-children'
 
 export type JobType =
   | 'activitypub-http-unicast'
   | 'activitypub-http-broadcast'
+  | 'activitypub-http-broadcast-parallel'
   | 'activitypub-http-fetcher'
   | 'activitypub-cleaner'
   | 'activitypub-follow'
@@ -24,10 +25,12 @@ export type JobType =
   | 'manage-video-torrent'
   | 'move-to-object-storage'
   | 'video-studio-edition'
+  | 'notify'
+  | 'federate-video'
 
 export interface Job {
-  id: number
-  state: JobState
+  id: number | string
+  state: JobState | 'unknown'
   type: JobType
   data: any
   priority: number
@@ -125,7 +128,6 @@ export interface HLSTranscodingPayload extends BaseTranscodingPayload {
   copyCodecs: boolean
 
   hasAudio: boolean
-  isPortraitMode?: boolean
 
   autoDeleteWebTorrentIfNeeded: boolean
   isMaxQuality: boolean
@@ -137,8 +139,6 @@ export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodi
 
   hasAudio: boolean
   createHLSIfNeeded: boolean
-
-  isPortraitMode?: boolean
 }
 
 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
@@ -160,6 +160,8 @@ export type VideoTranscodingPayload =
 export interface VideoLiveEndingPayload {
   videoId: number
   publishedAt: string
+  liveSessionId: number
+  streamingPlaylistId: number
 
   replayDirectory?: string
 }
@@ -214,3 +216,18 @@ export interface VideoStudioEditionPayload {
   videoUUID: string
   tasks: VideoStudioTaskPayload[]
 }
+
+// ---------------------------------------------------------------------------
+
+export type NotifyPayload =
+  {
+    action: 'new-video'
+    videoUUID: string
+  }
+
+// ---------------------------------------------------------------------------
+
+export interface FederateVideoPayload {
+  videoUUID: string
+  isNewVideo: boolean
+}