aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/remote/videos.js1
-rw-r--r--server/helpers/custom-validators/videos.js5
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 9a9055676..df8f8a22e 100644
--- a/server/helpers/custom-validators/remote/videos.js
+++ b/server/helpers/custom-validators/remote/videos.js
@@ -87,6 +87,7 @@ function isCommonVideoAttributesValid (video) {
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.isVideoLicenceValid(video.licence) &&
90 videosValidators.isVideoNSFWValid(video.nsfw) &&
90 videosValidators.isVideoDescriptionValid(video.description) && 91 videosValidators.isVideoDescriptionValid(video.description) &&
91 videosValidators.isVideoDurationValid(video.duration) && 92 videosValidators.isVideoDurationValid(video.duration) &&
92 videosValidators.isVideoInfoHashValid(video.infoHash) && 93 videosValidators.isVideoInfoHashValid(video.infoHash) &&
diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js
index 8495e9665..d0b08e7ac 100644
--- a/server/helpers/custom-validators/videos.js
+++ b/server/helpers/custom-validators/videos.js
@@ -15,6 +15,7 @@ const videosValidators = {
15 isVideoDateValid, 15 isVideoDateValid,
16 isVideoCategoryValid, 16 isVideoCategoryValid,
17 isVideoLicenceValid, 17 isVideoLicenceValid,
18 isVideoNSFWValid,
18 isVideoDescriptionValid, 19 isVideoDescriptionValid,
19 isVideoDurationValid, 20 isVideoDurationValid,
20 isVideoInfoHashValid, 21 isVideoInfoHashValid,
@@ -50,6 +51,10 @@ function isVideoLicenceValid (value) {
50 return constants.VIDEO_LICENCES[value] !== undefined 51 return constants.VIDEO_LICENCES[value] !== undefined
51} 52}
52 53
54function isVideoNSFWValid (value) {
55 return validator.isBoolean(value)
56}
57
53function isVideoDescriptionValid (value) { 58function isVideoDescriptionValid (value) {
54 return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) 59 return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION)
55} 60}