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

pull/6454/head
kontrollanten 2024-06-20 12:51:04 +02:00 committed by Chocobozzz
parent e3161f4105
commit ab22399da0
1 changed files with 2 additions and 2 deletions

View File

@ -150,11 +150,11 @@ function listVideoPrivacies (_req: express.Request, res: express.Response) {
res.json(VIDEO_PRIVACIES) 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 videoId = res.locals.videoAPI.id
const userId = res.locals.oauth?.token.User.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 // Filter may return null/undefined value to forbid video access
if (!video) return res.sendStatus(HttpStatusCode.NOT_FOUND_404) if (!video) return res.sendStatus(HttpStatusCode.NOT_FOUND_404)