From c39e86b898370a55c147ed1958db00723b0364e4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 28 Sep 2018 10:18:37 +0200 Subject: Fix video description when importing by url --- server/models/video/video-format-utils.ts | 3 ++- server/models/video/video-import.ts | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'server/models/video') 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 { -- cgit v1.2.3