Update videos response api

This commit is contained in:
Chocobozzz 2018-03-19 10:24:12 +01:00
parent f47776e265
commit ae5a3dd664
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 62 additions and 48 deletions

View file

@ -26,8 +26,12 @@ function isVideoLicenceValid (value: number) {
return value === null || VIDEO_LICENCES[value] !== undefined
}
function areVideoLanguagesValid (value: number[]) {
return value === null || (isArray(value) && value.every(v => isVideoLanguageValid(v)))
}
function isVideoLanguageValid (value: number) {
return value === null || VIDEO_LANGUAGES[value] !== undefined
return VIDEO_LANGUAGES[value] !== undefined
}
function isVideoDurationValid (value: string) {
@ -133,6 +137,7 @@ export {
isVideoDescriptionValid,
isVideoFileInfoHashValid,
isVideoNameValid,
areVideoLanguagesValid,
isVideoTagsValid,
isVideoAbuseReasonValid,
isVideoFile,