diff options
Diffstat (limited to 'server/middlewares/validators/videos/videos.ts')
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 159727e28..a5e3ed0dc 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -46,7 +46,7 @@ import { VideoFetchType } from '../../../helpers/video' | |||
46 | import { isNSFWQueryValid, isNumberArray, isStringArray } from '../../../helpers/custom-validators/search' | 46 | import { isNSFWQueryValid, isNumberArray, isStringArray } from '../../../helpers/custom-validators/search' |
47 | import { getServerActor } from '../../../helpers/utils' | 47 | import { getServerActor } from '../../../helpers/utils' |
48 | 48 | ||
49 | const videosAddValidator = getCommonVideoAttributes().concat([ | 49 | const videosAddValidator = getCommonVideoEditAttributes().concat([ |
50 | body('videofile') | 50 | body('videofile') |
51 | .custom((value, { req }) => isVideoFile(req.files)).withMessage( | 51 | .custom((value, { req }) => isVideoFile(req.files)).withMessage( |
52 | 'This file is not supported or too large. Please, make sure it is of the following type: ' | 52 | 'This file is not supported or too large. Please, make sure it is of the following type: ' |
@@ -94,7 +94,7 @@ const videosAddValidator = getCommonVideoAttributes().concat([ | |||
94 | } | 94 | } |
95 | ]) | 95 | ]) |
96 | 96 | ||
97 | const videosUpdateValidator = getCommonVideoAttributes().concat([ | 97 | const videosUpdateValidator = getCommonVideoEditAttributes().concat([ |
98 | param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), | 98 | param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), |
99 | body('name') | 99 | body('name') |
100 | .optional() | 100 | .optional() |
@@ -288,7 +288,7 @@ const videosAcceptChangeOwnershipValidator = [ | |||
288 | } | 288 | } |
289 | ] | 289 | ] |
290 | 290 | ||
291 | function getCommonVideoAttributes () { | 291 | function getCommonVideoEditAttributes () { |
292 | return [ | 292 | return [ |
293 | body('thumbnailfile') | 293 | body('thumbnailfile') |
294 | .custom((value, { req }) => isVideoImage(req.files, 'thumbnailfile')).withMessage( | 294 | .custom((value, { req }) => isVideoImage(req.files, 'thumbnailfile')).withMessage( |
@@ -421,7 +421,7 @@ export { | |||
421 | videosTerminateChangeOwnershipValidator, | 421 | videosTerminateChangeOwnershipValidator, |
422 | videosAcceptChangeOwnershipValidator, | 422 | videosAcceptChangeOwnershipValidator, |
423 | 423 | ||
424 | getCommonVideoAttributes, | 424 | getCommonVideoEditAttributes, |
425 | 425 | ||
426 | commonVideosFiltersValidator | 426 | commonVideosFiltersValidator |
427 | } | 427 | } |