diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-03-28 21:19:46 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-03-28 21:19:46 +0200 |
commit | 31b59b477459d4f26ed8ef089a0e5553fb6a332b (patch) | |
tree | 70de15dc172045d01ad45718f55c22d5ca43b354 /server/helpers/custom-validators/videos.js | |
parent | d07137b90b2b2b0c1e93a6f0e7bf8719b133027c (diff) | |
download | PeerTube-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.js | 5 |
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 | ||
54 | function isVideoNSFWValid (value) { | ||
55 | return validator.isBoolean(value) | ||
56 | } | ||
57 | |||
53 | function isVideoDescriptionValid (value) { | 58 | function isVideoDescriptionValid (value) { |
54 | return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) | 59 | return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) |
55 | } | 60 | } |