diff options
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/remote/videos.js | 1 | ||||
-rw-r--r-- | server/helpers/custom-validators/videos.js | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/remote/videos.js b/server/helpers/custom-validators/remote/videos.js index 701acdbfd..9a9055676 100644 --- a/server/helpers/custom-validators/remote/videos.js +++ b/server/helpers/custom-validators/remote/videos.js | |||
@@ -86,6 +86,7 @@ function isCommonVideoAttributesValid (video) { | |||
86 | return videosValidators.isVideoDateValid(video.createdAt) && | 86 | return videosValidators.isVideoDateValid(video.createdAt) && |
87 | videosValidators.isVideoDateValid(video.updatedAt) && | 87 | videosValidators.isVideoDateValid(video.updatedAt) && |
88 | videosValidators.isVideoCategoryValid(video.category) && | 88 | videosValidators.isVideoCategoryValid(video.category) && |
89 | videosValidators.isVideoLicenceValid(video.licence) && | ||
89 | videosValidators.isVideoDescriptionValid(video.description) && | 90 | videosValidators.isVideoDescriptionValid(video.description) && |
90 | videosValidators.isVideoDurationValid(video.duration) && | 91 | videosValidators.isVideoDurationValid(video.duration) && |
91 | videosValidators.isVideoInfoHashValid(video.infoHash) && | 92 | videosValidators.isVideoInfoHashValid(video.infoHash) && |
diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js index efa89c427..8495e9665 100644 --- a/server/helpers/custom-validators/videos.js +++ b/server/helpers/custom-validators/videos.js | |||
@@ -14,6 +14,7 @@ const videosValidators = { | |||
14 | isVideoAuthorValid, | 14 | isVideoAuthorValid, |
15 | isVideoDateValid, | 15 | isVideoDateValid, |
16 | isVideoCategoryValid, | 16 | isVideoCategoryValid, |
17 | isVideoLicenceValid, | ||
17 | isVideoDescriptionValid, | 18 | isVideoDescriptionValid, |
18 | isVideoDurationValid, | 19 | isVideoDurationValid, |
19 | isVideoInfoHashValid, | 20 | isVideoInfoHashValid, |
@@ -45,6 +46,10 @@ function isVideoCategoryValid (value) { | |||
45 | return constants.VIDEO_CATEGORIES[value] !== undefined | 46 | return constants.VIDEO_CATEGORIES[value] !== undefined |
46 | } | 47 | } |
47 | 48 | ||
49 | function isVideoLicenceValid (value) { | ||
50 | return constants.VIDEO_LICENCES[value] !== undefined | ||
51 | } | ||
52 | |||
48 | function isVideoDescriptionValid (value) { | 53 | function isVideoDescriptionValid (value) { |
49 | return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) | 54 | return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) |
50 | } | 55 | } |