mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Add ability for uploaders to schedule video update
This commit is contained in:
parent
bf079b7bfd
commit
2baea0c77c
21 changed files with 469 additions and 22 deletions
|
@ -3,7 +3,7 @@ import 'express-validator'
|
|||
import { values } from 'lodash'
|
||||
import 'multer'
|
||||
import * as validator from 'validator'
|
||||
import { UserRight, VideoRateType } from '../../../shared'
|
||||
import { UserRight, VideoPrivacy, VideoRateType } from '../../../shared'
|
||||
import {
|
||||
CONSTRAINTS_FIELDS,
|
||||
VIDEO_CATEGORIES,
|
||||
|
@ -98,10 +98,18 @@ function isVideoImage (files: { [ fieldname: string ]: Express.Multer.File[] } |
|
|||
return isFileValid(files, videoImageTypesRegex, field, true)
|
||||
}
|
||||
|
||||
function isVideoPrivacyValid (value: string) {
|
||||
function isVideoPrivacyValid (value: number) {
|
||||
return validator.isInt(value + '') && VIDEO_PRIVACIES[ value ] !== undefined
|
||||
}
|
||||
|
||||
function isScheduleVideoUpdatePrivacyValid (value: number) {
|
||||
return validator.isInt(value + '') &&
|
||||
(
|
||||
value === VideoPrivacy.UNLISTED ||
|
||||
value === VideoPrivacy.PUBLIC
|
||||
)
|
||||
}
|
||||
|
||||
function isVideoFileInfoHashValid (value: string) {
|
||||
return exists(value) && validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.INFO_HASH)
|
||||
}
|
||||
|
@ -174,6 +182,7 @@ export {
|
|||
isVideoFileInfoHashValid,
|
||||
isVideoNameValid,
|
||||
isVideoTagsValid,
|
||||
isScheduleVideoUpdatePrivacyValid,
|
||||
isVideoAbuseReasonValid,
|
||||
isVideoFile,
|
||||
isVideoStateValid,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue