Skip to content

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

feat(plugins/filter): add req to api.video.get.result

kontrollantenab22399da0f6
diff --git a/server/core/controllers/api/videos/index.ts b/server/core/controllers/api/videos/index.ts
index ec6a50f08b..a962b67892 100644
--- a/server/core/controllers/api/videos/index.ts
+++ b/server/core/controllers/api/videos/index.ts
@@ -150,11 +150,11 @@ function listVideoPrivacies (_req: express.Request, res: express.Response) {
res.json(VIDEO_PRIVACIES)
}
-async function getVideo (_req: express.Request, res: express.Response) {
+async function getVideo (req: express.Request, res: express.Response) {
const videoId = res.locals.videoAPI.id
const userId = res.locals.oauth?.token.User.id
- const video = await Hooks.wrapObject(res.locals.videoAPI, 'filter:api.video.get.result', { id: videoId, userId })
+ const video = await Hooks.wrapObject(res.locals.videoAPI, 'filter:api.video.get.result', { req, id: videoId, userId })
// Filter may return null/undefined value to forbid video access
if (!video) return res.sendStatus(HttpStatusCode.NOT_FOUND_404)