X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fvideos.js;h=8495e9665965d3b9a759c6d2b09f1829a43e38ad;hb=6f0c39e2de400685b7baf8340b9e132f2659365a;hp=92b36671702b381179a8a0046b900cfad9ee6397;hpb=6e07c3de88791a0b342e0cc319590048117f9c2d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js index 92b366717..8495e9665 100644 --- a/server/helpers/custom-validators/videos.js +++ b/server/helpers/custom-validators/videos.js @@ -14,6 +14,7 @@ const videosValidators = { isVideoAuthorValid, isVideoDateValid, isVideoCategoryValid, + isVideoLicenceValid, isVideoDescriptionValid, isVideoDurationValid, isVideoInfoHashValid, @@ -45,6 +46,10 @@ function isVideoCategoryValid (value) { return constants.VIDEO_CATEGORIES[value] !== undefined } +function isVideoLicenceValid (value) { + return constants.VIDEO_LICENCES[value] !== undefined +} + function isVideoDescriptionValid (value) { return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) } @@ -69,8 +74,7 @@ function isVideoTagsValid (tags) { return miscValidators.isArray(tags) && validator.isInt(tags.length, VIDEOS_CONSTRAINTS_FIELDS.TAGS) && tags.every(function (tag) { - return validator.isAlphanumeric(tag) && - validator.isLength(tag, VIDEOS_CONSTRAINTS_FIELDS.TAG) + return validator.isLength(tag, VIDEOS_CONSTRAINTS_FIELDS.TAG) }) }