+ if (!await doesVideoBlacklistExist(res.locals.videoAll.id, res)) return
+
+ return next()
+ }
+]
+
+const videosBlacklistFiltersValidator = [
+ query('type')
+ .optional()
+ .customSanitizer(toIntOrNull)
+ .custom(isVideoBlacklistTypeValid).withMessage('Should have a valid video blacklist type attribute'),
+ query('search')
+ .optional()
+ .not()
+ .isEmpty().withMessage('Should have a valid search'),
+
+ (req: express.Request, res: express.Response, next: express.NextFunction) => {
+ logger.debug('Checking videos blacklist filters query', { parameters: req.query })
+
+ if (areValidationErrors(req, res)) return