]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/videos.js
Server: add nsfw attribute
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / videos.js
index 8495e9665965d3b9a759c6d2b09f1829a43e38ad..d0b08e7aca120ad89fb8e666482bd8f697c8a0f7 100644 (file)
@@ -15,6 +15,7 @@ const videosValidators = {
   isVideoDateValid,
   isVideoCategoryValid,
   isVideoLicenceValid,
+  isVideoNSFWValid,
   isVideoDescriptionValid,
   isVideoDurationValid,
   isVideoInfoHashValid,
@@ -50,6 +51,10 @@ function isVideoLicenceValid (value) {
   return constants.VIDEO_LICENCES[value] !== undefined
 }
 
+function isVideoNSFWValid (value) {
+  return validator.isBoolean(value)
+}
+
 function isVideoDescriptionValid (value) {
   return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION)
 }