From 1e74f19a2179df7fc2e0da73163ef2c3118cbecb Mon Sep 17 00:00:00 2001 From: clementbrizard Date: Sat, 12 Jan 2019 13:45:23 +0000 Subject: Enable video upload and edit --- server/helpers/custom-validators/videos.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'server/helpers') diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index e6f22e6c5..ce4492a30 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts @@ -13,7 +13,7 @@ import { VIDEO_STATES } from '../../initializers' import { VideoModel } from '../../models/video/video' -import { exists, isArray, isFileValid } from './misc' +import { exists, isArray, isDateValid, isFileValid } from './misc' import { VideoChannelModel } from '../../models/video/video-channel' import { UserModel } from '../../models/account/user' import * as magnetUtil from 'magnet-uri' @@ -115,6 +115,10 @@ function isScheduleVideoUpdatePrivacyValid (value: number) { ) } +function isVideoOriginallyPublishedAtValid (value: string | null) { + return value === null || isDateValid(value) +} + function isVideoFileInfoHashValid (value: string | null | undefined) { return exists(value) && validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.INFO_HASH) } @@ -220,6 +224,7 @@ export { isVideoTagsValid, isVideoFPSResolutionValid, isScheduleVideoUpdatePrivacyValid, + isVideoOriginallyPublishedAtValid, isVideoFile, isVideoMagnetUriValid, isVideoStateValid, -- cgit v1.2.3