1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Add to playlist dropdown

This commit is contained in:
Chocobozzz 2019-03-07 17:06:00 +01:00 committed by Chocobozzz
parent 830b4faff1
commit f0a3988066
55 changed files with 961 additions and 94 deletions

View file

@ -49,12 +49,19 @@ function toValueOrNull (value: string) {
return value
}
function toArray (value: string) {
function toArray (value: any) {
if (value && isArray(value) === false) return [ value ]
return value
}
function toIntArray (value: any) {
if (!value) return []
if (isArray(value) === false) return [ validator.toInt(value) ]
return value.map(v => validator.toInt(v))
}
function isFileValid (
files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[],
mimeTypeRegex: string,
@ -97,5 +104,6 @@ export {
isBooleanValid,
toIntOrNull,
toArray,
toIntArray,
isFileValid
}