From 3b504f6ed4e890bebb46d0481aba15b43050323a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Mar 2023 12:01:21 +0100 Subject: Add ability for plugins to alter video jsonld --- server/models/video/video.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'server/models/video/video.ts') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 1a10d2da2..7fe2ec293 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -137,6 +137,7 @@ import { VideoShareModel } from './video-share' import { VideoSourceModel } from './video-source' import { VideoStreamingPlaylistModel } from './video-streaming-playlist' import { VideoTagModel } from './video-tag' +import { Hooks } from '@server/lib/plugins/hooks' export enum ScopeNames { FOR_API = 'FOR_API', @@ -1713,8 +1714,12 @@ export class VideoModel extends Model>> { return files } - toActivityPubObject (this: MVideoAP): VideoObject { - return videoModelToActivityPubObject(this) + toActivityPubObject (this: MVideoAP): Promise { + return Hooks.wrapObject( + videoModelToActivityPubObject(this), + 'filter:activity-pub.video.jsonld.build.result', + { video: this } + ) } getTruncatedDescription () { -- cgit v1.2.3