diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-19 10:24:12 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-19 10:32:51 +0100 |
commit | ae5a3dd6642c8d5abc87b874496026dc9ed37d2d (patch) | |
tree | 10285733f8560d3cfad2ffbab88296689ad3ea55 /server/helpers/custom-validators | |
parent | f47776e265a45859aaf8519d7de85c6f35fdf40a (diff) | |
download | PeerTube-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.ts | 7 |
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 | ||
29 | function areVideoLanguagesValid (value: number[]) { | ||
30 | return value === null || (isArray(value) && value.every(v => isVideoLanguageValid(v))) | ||
31 | } | ||
32 | |||
29 | function isVideoLanguageValid (value: number) { | 33 | function isVideoLanguageValid (value: number) { |
30 | return value === null || VIDEO_LANGUAGES[value] !== undefined | 34 | return VIDEO_LANGUAGES[value] !== undefined |
31 | } | 35 | } |
32 | 36 | ||
33 | function isVideoDurationValid (value: string) { | 37 | function 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, |