From c5ca7e1e0c735d1e658f9ef524a61d19f6a50fea Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Tue, 15 Feb 2022 08:24:22 +0100 Subject: add filter:api.video-playlist.videos.list.* hooks closes #4775 --- server/controllers/api/video-playlist.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts index 795e14e73..ee6c73855 100644 --- a/server/controllers/api/video-playlist.ts +++ b/server/controllers/api/video-playlist.ts @@ -453,13 +453,19 @@ async function getVideoPlaylistVideos (req: express.Request, res: express.Respon const user = res.locals.oauth ? res.locals.oauth.token.User : undefined const server = await getServerActor() - const resultList = await VideoPlaylistElementModel.listForApi({ + const apiOptions = await Hooks.wrapObject({ start: req.query.start, count: req.query.count, videoPlaylistId: videoPlaylistInstance.id, serverAccount: server.Account, user - }) + }, 'filter:api.video-playlist.videos.list.params') + + const resultList = await Hooks.wrapPromiseFun( + VideoPlaylistElementModel.listForApi, + apiOptions, + 'filter:api.video-playlist.videos.list.result' + ) const options = { displayNSFW: buildNSFWFilter(res, req.query.nsfw), -- cgit v1.2.3