X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fvideos%2Fvideo-live.ts;h=a330d70a19957dcd45580084feac6f6f24fd4d88;hb=396f6f0140b0f76162e2378fd5a61e2f888673ed;hp=777b57e9aa8d9ba27438af917bcb0cb3b503eebf;hpb=97eba003a9d0adcb0cab9190f566327b1417c7d3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/videos/video-live.ts b/server/middlewares/validators/videos/video-live.ts index 777b57e9a..a330d70a1 100644 --- a/server/middlewares/validators/videos/video-live.ts +++ b/server/middlewares/validators/videos/video-live.ts @@ -56,7 +56,7 @@ const videoLiveGetValidator = [ const videoLiveAddValidator = getCommonVideoEditAttributes().concat([ body('channelId') .customSanitizer(toIntOrNull) - .custom(isIdValid).withMessage('Should have correct video channel id'), + .custom(isIdValid), body('name') .custom(isVideoNameValid).withMessage( @@ -66,18 +66,17 @@ const videoLiveAddValidator = getCommonVideoEditAttributes().concat([ body('saveReplay') .optional() .customSanitizer(toBooleanOrNull) - .custom(isBooleanValid).withMessage('Should have a valid saveReplay attribute'), + .custom(isBooleanValid).withMessage('Should have a valid saveReplay boolean'), body('permanentLive') .optional() .customSanitizer(toBooleanOrNull) - .custom(isBooleanValid).withMessage('Should have a valid permanentLive attribute'), + .custom(isBooleanValid).withMessage('Should have a valid permanentLive boolean'), body('latencyMode') .optional() .customSanitizer(toIntOrNull) - .custom(isLiveLatencyModeValid) - .withMessage('Should have a valid latency mode attribute'), + .custom(isLiveLatencyModeValid), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking videoLiveAddValidator parameters', { parameters: req.body }) @@ -156,13 +155,12 @@ const videoLiveUpdateValidator = [ body('saveReplay') .optional() .customSanitizer(toBooleanOrNull) - .custom(isBooleanValid).withMessage('Should have a valid saveReplay attribute'), + .custom(isBooleanValid).withMessage('Should have a valid saveReplay boolean'), body('latencyMode') .optional() .customSanitizer(toIntOrNull) - .custom(isLiveLatencyModeValid) - .withMessage('Should have a valid latency mode attribute'), + .custom(isLiveLatencyModeValid), (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking videoLiveUpdateValidator parameters', { parameters: req.body })