From 9901c8d6908a43ab4594406446eac770ee21176c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 25 Jul 2023 15:17:58 +0200 Subject: Add video file update hook tests --- server/middlewares/validators/videos/shared/video-validators.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'server/middlewares/validators') diff --git a/server/middlewares/validators/videos/shared/video-validators.ts b/server/middlewares/validators/videos/shared/video-validators.ts index 72536011d..95e4fef11 100644 --- a/server/middlewares/validators/videos/shared/video-validators.ts +++ b/server/middlewares/validators/videos/shared/video-validators.ts @@ -45,7 +45,7 @@ export async function isVideoFileAccepted (options: { videoFile: express.VideoUploadFile hook: Extract }) { - const { req, res, videoFile } = options + const { req, res, videoFile, hook } = options // Check we accept this video const acceptParameters = { @@ -53,11 +53,7 @@ export async function isVideoFileAccepted (options: { videoFile, user: res.locals.oauth.token.User } - const acceptedResult = await Hooks.wrapFun( - isLocalVideoFileAccepted, - acceptParameters, - 'filter:api.video.upload.accept.result' - ) + const acceptedResult = await Hooks.wrapFun(isLocalVideoFileAccepted, acceptParameters, hook) if (!acceptedResult || acceptedResult.accepted !== true) { logger.info('Refused local video file.', { acceptedResult, acceptParameters }) -- cgit v1.2.3