]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/server/job.model.ts
Save replay of permanent live in client
[github/Chocobozzz/PeerTube.git] / shared / models / server / job.model.ts
index 1519d1c3e4bab01f3fdfa5124604bde145208140..9370cf011caedc0bbda00f887259438585c7e9ff 100644 (file)
@@ -1,4 +1,6 @@
 import { ContextType } from '../activitypub/context'
+import { VideoState } from '../videos'
+import { VideoStudioTaskCut } from '../videos/studio'
 import { VideoResolution } from '../videos/file/video-resolution.enum'
 import { SendEmailOptions } from './emailer.model'
 
@@ -19,7 +21,9 @@ export type JobType =
   | 'video-redundancy'
   | 'video-live-ending'
   | 'actor-keys'
+  | 'manage-video-torrent'
   | 'move-to-object-storage'
+  | 'video-studio-edition'
 
 export interface Job {
   id: number
@@ -36,9 +40,9 @@ export interface Job {
 
 export type ActivitypubHttpBroadcastPayload = {
   uris: string[]
-  signatureActorId?: number
+  contextType: ContextType
   body: any
-  contextType?: ContextType
+  signatureActorId?: number
 }
 
 export type ActivitypubFollowPayload = {
@@ -49,7 +53,7 @@ export type ActivitypubFollowPayload = {
   assertIsChannel?: boolean
 }
 
-export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists'
+export type FetchType = 'activity' | 'video-shares' | 'video-comments' | 'account-playlists'
 export type ActivitypubHttpFetcherPayload = {
   uri: string
   type: FetchType
@@ -58,9 +62,9 @@ export type ActivitypubHttpFetcherPayload = {
 
 export type ActivitypubHttpUnicastPayload = {
   uri: string
+  contextType: ContextType
   signatureActorId?: number
   body: object
-  contextType?: ContextType
 }
 
 export type RefreshPayload = {
@@ -94,6 +98,20 @@ export type VideoRedundancyPayload = {
   videoId: number
 }
 
+export type ManageVideoTorrentPayload =
+  {
+    action: 'create'
+    videoId: number
+    videoFileId: number
+  } | {
+    action: 'update-metadata'
+
+    videoId?: number
+    streamingPlaylistId?: number
+
+    videoFileId: number
+  }
+
 // Video transcoding payloads
 
 interface BaseTranscodingPayload {
@@ -141,6 +159,9 @@ export type VideoTranscodingPayload =
 
 export interface VideoLiveEndingPayload {
   videoId: number
+  publishedAt: string
+
+  replayDirectory?: string
 }
 
 export interface ActorKeysPayload {
@@ -154,4 +175,42 @@ export interface DeleteResumableUploadMetaFilePayload {
 export interface MoveObjectStoragePayload {
   videoUUID: string
   isNewVideo: boolean
+  previousVideoState: VideoState
+}
+
+export type VideoStudioTaskCutPayload = VideoStudioTaskCut
+
+export type VideoStudioTaskIntroPayload = {
+  name: 'add-intro'
+
+  options: {
+    file: string
+  }
+}
+
+export type VideoStudioTaskOutroPayload = {
+  name: 'add-outro'
+
+  options: {
+    file: string
+  }
+}
+
+export type VideoStudioTaskWatermarkPayload = {
+  name: 'add-watermark'
+
+  options: {
+    file: string
+  }
+}
+
+export type VideoStudioTaskPayload =
+  VideoStudioTaskCutPayload |
+  VideoStudioTaskIntroPayload |
+  VideoStudioTaskOutroPayload |
+  VideoStudioTaskWatermarkPayload
+
+export interface VideoStudioEditionPayload {
+  videoUUID: string
+  tasks: VideoStudioTaskPayload[]
 }