]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix video description when importing by url
authorChocobozzz <me@florianbigard.com>
Fri, 28 Sep 2018 08:18:37 +0000 (10:18 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 28 Sep 2018 08:18:37 +0000 (10:18 +0200)
server/models/video/video-format-utils.ts
server/models/video/video-import.ts

index a9a58624dee16e1d7c75246fb21125205e7ecdf3..18364a287d73e5f6a69b33693cae19b0d92effe1 100644 (file)
@@ -12,6 +12,7 @@ import {
 } from '../../lib/activitypub'
 
 export type VideoFormattingJSONOptions = {
+  completeDescription?: boolean
   additionalAttributes: {
     state?: boolean,
     waitTranscoding?: boolean,
@@ -44,7 +45,7 @@ function videoModelToFormattedJSON (video: VideoModel, options?: VideoFormatting
       label: VideoModel.getPrivacyLabel(video.privacy)
     },
     nsfw: video.nsfw,
-    description: video.getTruncatedDescription(),
+    description: options.completeDescription === true ? video.description : video.getTruncatedDescription(),
     isLocal: video.isOwned(),
     duration: video.duration,
     views: video.views,
index 9d1f783c75e3a91d6cd647544ec13d89b15e2b0e..8d442b3f849940526fe5207afd157364f772dada 100644 (file)
@@ -146,12 +146,11 @@ export class VideoImportModel extends Model<VideoImportModel> {
 
   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 {