aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/redundancy.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/redundancy.ts')
-rw-r--r--server/middlewares/validators/redundancy.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/middlewares/validators/redundancy.ts b/server/middlewares/validators/redundancy.ts
index d31b216f5..a74772bd1 100644
--- a/server/middlewares/validators/redundancy.ts
+++ b/server/middlewares/validators/redundancy.ts
@@ -22,11 +22,11 @@ const videoFileRedundancyGetValidator = [
22 22
23 param('resolution') 23 param('resolution')
24 .customSanitizer(toIntOrNull) 24 .customSanitizer(toIntOrNull)
25 .custom(exists).withMessage('Should have a valid resolution'), 25 .custom(exists),
26 param('fps') 26 param('fps')
27 .optional() 27 .optional()
28 .customSanitizer(toIntOrNull) 28 .customSanitizer(toIntOrNull)
29 .custom(exists).withMessage('Should have a valid fps'), 29 .custom(exists),
30 30
31 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 31 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
32 logger.debug('Checking videoFileRedundancyGetValidator parameters', { parameters: req.params }) 32 logger.debug('Checking videoFileRedundancyGetValidator parameters', { parameters: req.params })
@@ -69,7 +69,7 @@ const videoPlaylistRedundancyGetValidator = [
69 69
70 param('streamingPlaylistType') 70 param('streamingPlaylistType')
71 .customSanitizer(toIntOrNull) 71 .customSanitizer(toIntOrNull)
72 .custom(exists).withMessage('Should have a valid streaming playlist type'), 72 .custom(exists),
73 73
74 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 74 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
75 logger.debug('Checking videoPlaylistRedundancyGetValidator parameters', { parameters: req.params }) 75 logger.debug('Checking videoPlaylistRedundancyGetValidator parameters', { parameters: req.params })
@@ -104,10 +104,12 @@ const videoPlaylistRedundancyGetValidator = [
104] 104]
105 105
106const updateServerRedundancyValidator = [ 106const updateServerRedundancyValidator = [
107 param('host').custom(isHostValid).withMessage('Should have a valid host'), 107 param('host')
108 .custom(isHostValid),
109
108 body('redundancyAllowed') 110 body('redundancyAllowed')
109 .customSanitizer(toBooleanOrNull) 111 .customSanitizer(toBooleanOrNull)
110 .custom(isBooleanValid).withMessage('Should have a valid redundancyAllowed attribute'), 112 .custom(isBooleanValid).withMessage('Should have a valid redundancyAllowed boolean'),
111 113
112 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 114 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
113 logger.debug('Checking updateServerRedundancy parameters', { parameters: req.params }) 115 logger.debug('Checking updateServerRedundancy parameters', { parameters: req.params })
@@ -130,7 +132,7 @@ const updateServerRedundancyValidator = [
130 132
131const listVideoRedundanciesValidator = [ 133const listVideoRedundanciesValidator = [
132 query('target') 134 query('target')
133 .custom(isVideoRedundancyTarget).withMessage('Should have a valid video redundancies target'), 135 .custom(isVideoRedundancyTarget),
134 136
135 (req: express.Request, res: express.Response, next: express.NextFunction) => { 137 (req: express.Request, res: express.Response, next: express.NextFunction) => {
136 logger.debug('Checking listVideoRedundanciesValidator parameters', { parameters: req.query }) 138 logger.debug('Checking listVideoRedundanciesValidator parameters', { parameters: req.query })
@@ -144,8 +146,7 @@ const listVideoRedundanciesValidator = [
144const addVideoRedundancyValidator = [ 146const addVideoRedundancyValidator = [
145 body('videoId') 147 body('videoId')
146 .customSanitizer(toCompleteUUID) 148 .customSanitizer(toCompleteUUID)
147 .custom(isIdOrUUIDValid) 149 .custom(isIdOrUUIDValid),
148 .withMessage('Should have a valid video id'),
149 150
150 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 151 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
151 logger.debug('Checking addVideoRedundancyValidator parameters', { parameters: req.query }) 152 logger.debug('Checking addVideoRedundancyValidator parameters', { parameters: req.query })
@@ -176,8 +177,7 @@ const addVideoRedundancyValidator = [
176 177
177const removeVideoRedundancyValidator = [ 178const removeVideoRedundancyValidator = [
178 param('redundancyId') 179 param('redundancyId')
179 .custom(isIdValid) 180 .custom(isIdValid),
180 .withMessage('Should have a valid redundancy id'),
181 181
182 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 182 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
183 logger.debug('Checking removeVideoRedundancyValidator parameters', { parameters: req.query }) 183 logger.debug('Checking removeVideoRedundancyValidator parameters', { parameters: req.query })