aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/videos.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-03-22 21:15:55 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-03-22 21:25:24 +0100
commit6e07c3de88791a0b342e0cc319590048117f9c2d (patch)
tree049f88d3f6d3ec0aeea09702a583deb86d6ef78f /server/helpers/custom-validators/videos.js
parent2d7653dc8726185615bab66353c4e3fb8fbb5a5f (diff)
downloadPeerTube-6e07c3de88791a0b342e0cc319590048117f9c2d.tar.gz
PeerTube-6e07c3de88791a0b342e0cc319590048117f9c2d.tar.zst
PeerTube-6e07c3de88791a0b342e0cc319590048117f9c2d.zip
Add video category support
Diffstat (limited to 'server/helpers/custom-validators/videos.js')
-rw-r--r--server/helpers/custom-validators/videos.js5
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
13const videosValidators = { 13const 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
44function isVideoCategoryValid (value) {
45 return constants.VIDEO_CATEGORIES[value] !== undefined
46}
47
43function isVideoDescriptionValid (value) { 48function isVideoDescriptionValid (value) {
44 return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) 49 return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION)
45} 50}