aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2022-02-15 08:24:22 +0100
committerChocobozzz <chocobozzz@cpy.re>2022-02-28 10:56:37 +0100
commitc5ca7e1e0c735d1e658f9ef524a61d19f6a50fea (patch)
tree84c83e4ca9d7950ee2b5edad8b76dc7d5ab31031 /server/controllers
parentc729caf6cc34630877a0e5a1bda1719384cd0c8a (diff)
downloadPeerTube-c5ca7e1e0c735d1e658f9ef524a61d19f6a50fea.tar.gz
PeerTube-c5ca7e1e0c735d1e658f9ef524a61d19f6a50fea.tar.zst
PeerTube-c5ca7e1e0c735d1e658f9ef524a61d19f6a50fea.zip
add filter:api.video-playlist.videos.list.* hooks
closes #4775
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/video-playlist.ts10
1 files changed, 8 insertions, 2 deletions
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
453 const user = res.locals.oauth ? res.locals.oauth.token.User : undefined 453 const user = res.locals.oauth ? res.locals.oauth.token.User : undefined
454 const server = await getServerActor() 454 const server = await getServerActor()
455 455
456 const resultList = await VideoPlaylistElementModel.listForApi({ 456 const apiOptions = await Hooks.wrapObject({
457 start: req.query.start, 457 start: req.query.start,
458 count: req.query.count, 458 count: req.query.count,
459 videoPlaylistId: videoPlaylistInstance.id, 459 videoPlaylistId: videoPlaylistInstance.id,
460 serverAccount: server.Account, 460 serverAccount: server.Account,
461 user 461 user
462 }) 462 }, 'filter:api.video-playlist.videos.list.params')
463
464 const resultList = await Hooks.wrapPromiseFun(
465 VideoPlaylistElementModel.listForApi,
466 apiOptions,
467 'filter:api.video-playlist.videos.list.result'
468 )
463 469
464 const options = { 470 const options = {
465 displayNSFW: buildNSFWFilter(res, req.query.nsfw), 471 displayNSFW: buildNSFWFilter(res, req.query.nsfw),