]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/server/job.model.ts
Channel sync (#5135)
[github/Chocobozzz/PeerTube.git] / shared / models / server / job.model.ts
index 8c8f64de9a9dc082e927af171720f0ed0678b9b5..137da367cdd2ec074f4a4a52cedf8bc9c041029e 100644 (file)
@@ -25,6 +25,8 @@ export type JobType =
   | 'manage-video-torrent'
   | 'move-to-object-storage'
   | 'video-studio-edition'
+  | 'video-channel-import'
+  | 'after-video-channel-import'
   | 'notify'
   | 'federate-video'
 
@@ -82,20 +84,32 @@ export type VideoFileImportPayload = {
   filePath: string
 }
 
+// ---------------------------------------------------------------------------
+
 export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
 export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
 
-export type VideoImportYoutubeDLPayload = {
+export interface VideoImportYoutubeDLPayload {
   type: VideoImportYoutubeDLPayloadType
   videoImportId: number
 
   fileExt?: string
 }
-export type VideoImportTorrentPayload = {
+
+export interface VideoImportTorrentPayload {
   type: VideoImportTorrentPayloadType
   videoImportId: number
 }
-export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload
+
+export type VideoImportPayload = (VideoImportYoutubeDLPayload | VideoImportTorrentPayload) & {
+  preventException: boolean
+}
+
+export interface VideoImportPreventExceptionResult {
+  resultType: 'success' | 'error'
+}
+
+// ---------------------------------------------------------------------------
 
 export type VideoRedundancyPayload = {
   videoId: number
@@ -219,6 +233,17 @@ export interface VideoStudioEditionPayload {
 
 // ---------------------------------------------------------------------------
 
+export interface VideoChannelImportPayload {
+  externalChannelUrl: string
+  videoChannelId: number
+}
+
+export interface AfterVideoChannelImportPayload {
+  channelSyncId: number
+}
+
+// ---------------------------------------------------------------------------
+
 export type NotifyPayload =
   {
     action: 'new-video'