diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-03-27 20:53:11 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-03-27 20:53:11 +0200 |
commit | 6f0c39e2de400685b7baf8340b9e132f2659365a (patch) | |
tree | b036c6ebf65ff4cb7f5649fc48a0b7201370bddd /server/helpers | |
parent | 28974889281523eec5b00dd5596c67d99c5167e5 (diff) | |
download | PeerTube-6f0c39e2de400685b7baf8340b9e132f2659365a.tar.gz PeerTube-6f0c39e2de400685b7baf8340b9e132f2659365a.tar.zst PeerTube-6f0c39e2de400685b7baf8340b9e132f2659365a.zip |
Server: add licence video attribute
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/custom-validators/remote/videos.js | 1 | ||||
-rw-r--r-- | server/helpers/custom-validators/videos.js | 5 |
2 files changed, 6 insertions, 0 deletions
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) { | |||
86 | return videosValidators.isVideoDateValid(video.createdAt) && | 86 | return videosValidators.isVideoDateValid(video.createdAt) && |
87 | videosValidators.isVideoDateValid(video.updatedAt) && | 87 | videosValidators.isVideoDateValid(video.updatedAt) && |
88 | videosValidators.isVideoCategoryValid(video.category) && | 88 | videosValidators.isVideoCategoryValid(video.category) && |
89 | videosValidators.isVideoLicenceValid(video.licence) && | ||
89 | videosValidators.isVideoDescriptionValid(video.description) && | 90 | videosValidators.isVideoDescriptionValid(video.description) && |
90 | videosValidators.isVideoDurationValid(video.duration) && | 91 | videosValidators.isVideoDurationValid(video.duration) && |
91 | videosValidators.isVideoInfoHashValid(video.infoHash) && | 92 | 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 = { | |||
14 | isVideoAuthorValid, | 14 | isVideoAuthorValid, |
15 | isVideoDateValid, | 15 | isVideoDateValid, |
16 | isVideoCategoryValid, | 16 | isVideoCategoryValid, |
17 | isVideoLicenceValid, | ||
17 | isVideoDescriptionValid, | 18 | isVideoDescriptionValid, |
18 | isVideoDurationValid, | 19 | isVideoDurationValid, |
19 | isVideoInfoHashValid, | 20 | isVideoInfoHashValid, |
@@ -45,6 +46,10 @@ function isVideoCategoryValid (value) { | |||
45 | return constants.VIDEO_CATEGORIES[value] !== undefined | 46 | return constants.VIDEO_CATEGORIES[value] !== undefined |
46 | } | 47 | } |
47 | 48 | ||
49 | function isVideoLicenceValid (value) { | ||
50 | return constants.VIDEO_LICENCES[value] !== undefined | ||
51 | } | ||
52 | |||
48 | function isVideoDescriptionValid (value) { | 53 | function isVideoDescriptionValid (value) { |
49 | return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) | 54 | return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) |
50 | } | 55 | } |