From 6f0c39e2de400685b7baf8340b9e132f2659365a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 27 Mar 2017 20:53:11 +0200 Subject: Server: add licence video attribute --- server/helpers/custom-validators/remote/videos.js | 1 + server/helpers/custom-validators/videos.js | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'server/helpers') diff --git a/server/helpers/custom-validators/remote/videos.js b/server/helpers/custom-validators/remote/videos.js index 701acdbfd..9a9055676 100644 --- a/server/helpers/custom-validators/remote/videos.js +++ b/server/helpers/custom-validators/remote/videos.js @@ -86,6 +86,7 @@ function isCommonVideoAttributesValid (video) { return videosValidators.isVideoDateValid(video.createdAt) && videosValidators.isVideoDateValid(video.updatedAt) && videosValidators.isVideoCategoryValid(video.category) && + videosValidators.isVideoLicenceValid(video.licence) && videosValidators.isVideoDescriptionValid(video.description) && videosValidators.isVideoDurationValid(video.duration) && videosValidators.isVideoInfoHashValid(video.infoHash) && diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js index efa89c427..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) } -- cgit v1.2.3