]> 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 ac10ea9646c057d2729281ce5ce7ce75e05fab86..8c8f64de9a9dc082e927af171720f0ed0678b9b5 100644 (file)
@@ -4,7 +4,7 @@ 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'
@@ -25,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
@@ -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
+}