From 6e07c3de88791a0b342e0cc319590048117f9c2d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 22 Mar 2017 21:15:55 +0100 Subject: Add video category support --- server/helpers/custom-validators/videos.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server/helpers/custom-validators/videos.js') 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 const videosValidators = { isVideoAuthorValid, isVideoDateValid, + isVideoCategoryValid, isVideoDescriptionValid, isVideoDurationValid, isVideoInfoHashValid, @@ -40,6 +41,10 @@ function isVideoDateValid (value) { return validator.isDate(value) } +function isVideoCategoryValid (value) { + return constants.VIDEO_CATEGORIES[value] !== undefined +} + function isVideoDescriptionValid (value) { return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) } -- cgit v1.2.3