Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix video description when importing by url

Chocobozzzc39e86b89837
diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts
index a9a58624de..18364a287d 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 9d1f783c75..8d442b3f84 100644
--- a/server/models/video/video-import.ts
+++ b/server/models/video/video-import.ts
@@ -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 {