diff options
Diffstat (limited to 'server/helpers/custom-validators/videos.js')
-rw-r--r-- | server/helpers/custom-validators/videos.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js index 648c7540b..92b366717 100644 --- a/server/helpers/custom-validators/videos.js +++ b/server/helpers/custom-validators/videos.js | |||
@@ -13,6 +13,7 @@ const VIDEO_EVENTS_CONSTRAINTS_FIELDS = constants.CONSTRAINTS_FIELDS.VIDEO_EVENT | |||
13 | const videosValidators = { | 13 | const videosValidators = { |
14 | isVideoAuthorValid, | 14 | isVideoAuthorValid, |
15 | isVideoDateValid, | 15 | isVideoDateValid, |
16 | isVideoCategoryValid, | ||
16 | isVideoDescriptionValid, | 17 | isVideoDescriptionValid, |
17 | isVideoDurationValid, | 18 | isVideoDurationValid, |
18 | isVideoInfoHashValid, | 19 | isVideoInfoHashValid, |
@@ -40,6 +41,10 @@ function isVideoDateValid (value) { | |||
40 | return validator.isDate(value) | 41 | return validator.isDate(value) |
41 | } | 42 | } |
42 | 43 | ||
44 | function isVideoCategoryValid (value) { | ||
45 | return constants.VIDEO_CATEGORIES[value] !== undefined | ||
46 | } | ||
47 | |||
43 | function isVideoDescriptionValid (value) { | 48 | function isVideoDescriptionValid (value) { |
44 | return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) | 49 | return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) |
45 | } | 50 | } |