aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/videos.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-03-28 21:19:46 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-03-28 21:19:46 +0200
commit31b59b477459d4f26ed8ef089a0e5553fb6a332b (patch)
tree70de15dc172045d01ad45718f55c22d5ca43b354 /server/helpers/custom-validators/videos.js
parentd07137b90b2b2b0c1e93a6f0e7bf8719b133027c (diff)
downloadPeerTube-31b59b477459d4f26ed8ef089a0e5553fb6a332b.tar.gz
PeerTube-31b59b477459d4f26ed8ef089a0e5553fb6a332b.tar.zst
PeerTube-31b59b477459d4f26ed8ef089a0e5553fb6a332b.zip
Server: add nsfw attribute
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 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}