1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add video channels

This commit is contained in:
Chocobozzz 2017-10-24 19:41:09 +02:00
parent 8113a93a0d
commit 72c7248b6f
No known key found for this signature in database
GPG key ID: 583A612D890159BE
56 changed files with 2011 additions and 280 deletions

View file

@ -23,18 +23,6 @@ const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS
const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES
const VIDEO_EVENTS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_EVENTS
function isVideoIdOrUUIDValid (value: string) {
return validator.isInt(value) || isVideoUUIDValid(value)
}
function isVideoAuthorValid (value: string) {
return isUserUsernameValid(value)
}
function isVideoDateValid (value: string) {
return exists(value) && validator.isISO8601(value)
}
function isVideoCategoryValid (value: number) {
return VIDEO_CATEGORIES[value] !== undefined
}
@ -79,10 +67,6 @@ function isVideoThumbnailDataValid (value: string) {
return exists(value) && validator.isByteLength(value, VIDEOS_CONSTRAINTS_FIELDS.THUMBNAIL_DATA)
}
function isVideoUUIDValid (value: string) {
return exists(value) && validator.isUUID('' + value, 4)
}
function isVideoAbuseReasonValid (value: string) {
return exists(value) && validator.isLength(value, VIDEO_ABUSES_CONSTRAINTS_FIELDS.REASON)
}
@ -170,9 +154,6 @@ function checkVideoExists (id: string, res: express.Response, callback: () => vo
// ---------------------------------------------------------------------------
export {
isVideoIdOrUUIDValid,
isVideoAuthorValid,
isVideoDateValid,
isVideoCategoryValid,
isVideoLicenceValid,
isVideoLanguageValid,
@ -185,7 +166,6 @@ export {
isVideoThumbnailValid,
isVideoThumbnailDataValid,
isVideoFileExtnameValid,
isVideoUUIDValid,
isVideoAbuseReasonValid,
isVideoAbuseReporterUsernameValid,
isVideoFile,