From 3092476e64d09b449b4ad4f5198024afec1b22ca Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Apr 2017 12:13:37 +0200 Subject: Server: add video language 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 df8f8a22e..24715b4b3 100644 --- a/server/helpers/custom-validators/remote/videos.js +++ b/server/helpers/custom-validators/remote/videos.js @@ -87,6 +87,7 @@ function isCommonVideoAttributesValid (video) { videosValidators.isVideoDateValid(video.updatedAt) && videosValidators.isVideoCategoryValid(video.category) && videosValidators.isVideoLicenceValid(video.licence) && + videosValidators.isVideoLanguageValid(video.language) && videosValidators.isVideoNSFWValid(video.nsfw) && videosValidators.isVideoDescriptionValid(video.description) && videosValidators.isVideoDurationValid(video.duration) && diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js index d0b08e7ac..8dabb828d 100644 --- a/server/helpers/custom-validators/videos.js +++ b/server/helpers/custom-validators/videos.js @@ -15,6 +15,7 @@ const videosValidators = { isVideoDateValid, isVideoCategoryValid, isVideoLicenceValid, + isVideoLanguageValid, isVideoNSFWValid, isVideoDescriptionValid, isVideoDurationValid, @@ -51,6 +52,10 @@ function isVideoLicenceValid (value) { return constants.VIDEO_LICENCES[value] !== undefined } +function isVideoLanguageValid (value) { + return constants.VIDEO_LANGUAGES[value] !== undefined +} + function isVideoNSFWValid (value) { return validator.isBoolean(value) } -- cgit v1.2.3