aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-19 10:24:12 +0100
committerChocobozzz <me@florianbigard.com>2018-03-19 10:32:51 +0100
commitae5a3dd6642c8d5abc87b874496026dc9ed37d2d (patch)
tree10285733f8560d3cfad2ffbab88296689ad3ea55 /server/helpers/custom-validators
parentf47776e265a45859aaf8519d7de85c6f35fdf40a (diff)
downloadPeerTube-ae5a3dd6642c8d5abc87b874496026dc9ed37d2d.tar.gz
PeerTube-ae5a3dd6642c8d5abc87b874496026dc9ed37d2d.tar.zst
PeerTube-ae5a3dd6642c8d5abc87b874496026dc9ed37d2d.zip
Update videos response api
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,