Fix video description when importing by url

This commit is contained in:
Chocobozzz 2018-09-28 10:18:37 +02:00
parent 161b061d4e
commit c39e86b898
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 4 additions and 4 deletions

View 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,

View 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 {