aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/videos.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts
index a46d715ba..c08ddd24e 100644
--- a/server/helpers/custom-validators/videos.ts
+++ b/server/helpers/custom-validators/videos.ts
@@ -26,8 +26,12 @@ function isVideoLicenceValid (value: number) {
26 return value === null || VIDEO_LICENCES[value] !== undefined 26 return value === null || VIDEO_LICENCES[value] !== undefined
27} 27}
28 28
29function areVideoLanguagesValid (value: number[]) {
30 return value === null || (isArray(value) && value.every(v => isVideoLanguageValid(v)))
31}
32
29function isVideoLanguageValid (value: number) { 33function isVideoLanguageValid (value: number) {
30 return value === null || VIDEO_LANGUAGES[value] !== undefined 34 return VIDEO_LANGUAGES[value] !== undefined
31} 35}
32 36
33function isVideoDurationValid (value: string) { 37function isVideoDurationValid (value: string) {
@@ -133,6 +137,7 @@ export {
133 isVideoDescriptionValid, 137 isVideoDescriptionValid,
134 isVideoFileInfoHashValid, 138 isVideoFileInfoHashValid,
135 isVideoNameValid, 139 isVideoNameValid,
140 areVideoLanguagesValid,
136 isVideoTagsValid, 141 isVideoTagsValid,
137 isVideoAbuseReasonValid, 142 isVideoAbuseReasonValid,
138 isVideoFile, 143 isVideoFile,