mirror of https://github.com/Chocobozzz/PeerTube
Fix video description when importing by url
parent
161b061d4e
commit
c39e86b898
|
@ -12,6 +12,7 @@ import {
|
||||||
} from '../../lib/activitypub'
|
} from '../../lib/activitypub'
|
||||||
|
|
||||||
export type VideoFormattingJSONOptions = {
|
export type VideoFormattingJSONOptions = {
|
||||||
|
completeDescription?: boolean
|
||||||
additionalAttributes: {
|
additionalAttributes: {
|
||||||
state?: boolean,
|
state?: boolean,
|
||||||
waitTranscoding?: boolean,
|
waitTranscoding?: boolean,
|
||||||
|
@ -44,7 +45,7 @@ function videoModelToFormattedJSON (video: VideoModel, options?: VideoFormatting
|
||||||
label: VideoModel.getPrivacyLabel(video.privacy)
|
label: VideoModel.getPrivacyLabel(video.privacy)
|
||||||
},
|
},
|
||||||
nsfw: video.nsfw,
|
nsfw: video.nsfw,
|
||||||
description: video.getTruncatedDescription(),
|
description: options.completeDescription === true ? video.description : video.getTruncatedDescription(),
|
||||||
isLocal: video.isOwned(),
|
isLocal: video.isOwned(),
|
||||||
duration: video.duration,
|
duration: video.duration,
|
||||||
views: video.views,
|
views: video.views,
|
||||||
|
|
|
@ -146,12 +146,11 @@ export class VideoImportModel extends Model<VideoImportModel> {
|
||||||
|
|
||||||
toFormattedJSON (): VideoImport {
|
toFormattedJSON (): VideoImport {
|
||||||
const videoFormatOptions = {
|
const videoFormatOptions = {
|
||||||
|
completeDescription: true,
|
||||||
additionalAttributes: { state: true, waitTranscoding: true, scheduledUpdate: true }
|
additionalAttributes: { state: true, waitTranscoding: true, scheduledUpdate: true }
|
||||||
}
|
}
|
||||||
const video = this.Video
|
const video = this.Video
|
||||||
? Object.assign(this.Video.toFormattedJSON(videoFormatOptions), {
|
? Object.assign(this.Video.toFormattedJSON(videoFormatOptions), { tags: this.Video.Tags.map(t => t.name) })
|
||||||
tags: this.Video.Tags.map(t => t.name)
|
|
||||||
})
|
|
||||||
: undefined
|
: undefined
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue