From: Chocobozzz Date: Fri, 28 Sep 2018 08:18:37 +0000 (+0200) Subject: Fix video description when importing by url X-Git-Tag: v1.0.0-beta.16~31 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=c39e86b898370a55c147ed1958db00723b0364e4;p=github%2FChocobozzz%2FPeerTube.git Fix video description when importing by url --- diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index a9a58624d..18364a287 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts @@ -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, diff --git a/server/models/video/video-import.ts b/server/models/video/video-import.ts index 9d1f783c7..8d442b3f8 100644 --- a/server/models/video/video-import.ts +++ b/server/models/video/video-import.ts @@ -146,12 +146,11 @@ export class VideoImportModel extends Model { 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 {