]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-import.ts
Add import finished and video published notifs
[github/Chocobozzz/PeerTube.git] / server / models / video / video-import.ts
index b794d83244af4361e234673d822af2ea2b24b875..c723e57c0d20fe16f945b98db37811137f124418 100644 (file)
@@ -144,14 +144,17 @@ export class VideoImportModel extends Model<VideoImportModel> {
                            })
   }
 
+  getTargetIdentifier () {
+    return this.targetUrl || this.magnetUri || this.torrentName
+  }
+
   toFormattedJSON (): VideoImport {
     const videoFormatOptions = {
+      completeDescription: true,
       additionalAttributes: { state: true, waitTranscoding: true, scheduledUpdate: true }
     }
     const video = this.Video
-      ? Object.assign(this.Video.toFormattedJSON(videoFormatOptions), {
-        tags: this.Video.Tags.map(t => t.name)
-      })
+      ? Object.assign(this.Video.toFormattedJSON(videoFormatOptions), { tags: this.Video.Tags.map(t => t.name) })
       : undefined
 
     return {
@@ -171,6 +174,7 @@ export class VideoImportModel extends Model<VideoImportModel> {
       video
     }
   }
+
   private static getStateLabel (id: number) {
     return VIDEO_IMPORT_STATES[id] || 'Unknown'
   }