Fix video description when importing by url
This commit is contained in:
parent
161b061d4e
commit
c39e86b898
2 changed files with 4 additions and 4 deletions
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue