diff options
author | clementbrizard <clementbrizard53@gmail.com> | 2019-01-12 13:45:23 +0000 |
---|---|---|
committer | clementbrizard <clementbrizard53@gmail.com> | 2019-01-12 13:45:23 +0000 |
commit | 1e74f19a2179df7fc2e0da73163ef2c3118cbecb (patch) | |
tree | d00a7b500e5ffe4973f4ce4a52b85da28733ae28 /server/helpers/custom-validators/videos.ts | |
parent | c80341655fce5e70ad6da7d812e2ddeb1f8ef7f2 (diff) | |
download | PeerTube-1e74f19a2179df7fc2e0da73163ef2c3118cbecb.tar.gz PeerTube-1e74f19a2179df7fc2e0da73163ef2c3118cbecb.tar.zst PeerTube-1e74f19a2179df7fc2e0da73163ef2c3118cbecb.zip |
Enable video upload and edit
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 7 |
1 files changed, 6 insertions, 1 deletions
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 { | |||
13 | VIDEO_STATES | 13 | VIDEO_STATES |
14 | } from '../../initializers' | 14 | } from '../../initializers' |
15 | import { VideoModel } from '../../models/video/video' | 15 | import { VideoModel } from '../../models/video/video' |
16 | import { exists, isArray, isFileValid } from './misc' | 16 | import { exists, isArray, isDateValid, isFileValid } from './misc' |
17 | import { VideoChannelModel } from '../../models/video/video-channel' | 17 | import { VideoChannelModel } from '../../models/video/video-channel' |
18 | import { UserModel } from '../../models/account/user' | 18 | import { UserModel } from '../../models/account/user' |
19 | import * as magnetUtil from 'magnet-uri' | 19 | import * as magnetUtil from 'magnet-uri' |
@@ -115,6 +115,10 @@ function isScheduleVideoUpdatePrivacyValid (value: number) { | |||
115 | ) | 115 | ) |
116 | } | 116 | } |
117 | 117 | ||
118 | function isVideoOriginallyPublishedAtValid (value: string | null) { | ||
119 | return value === null || isDateValid(value) | ||
120 | } | ||
121 | |||
118 | function isVideoFileInfoHashValid (value: string | null | undefined) { | 122 | function isVideoFileInfoHashValid (value: string | null | undefined) { |
119 | return exists(value) && validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.INFO_HASH) | 123 | return exists(value) && validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.INFO_HASH) |
120 | } | 124 | } |
@@ -220,6 +224,7 @@ export { | |||
220 | isVideoTagsValid, | 224 | isVideoTagsValid, |
221 | isVideoFPSResolutionValid, | 225 | isVideoFPSResolutionValid, |
222 | isScheduleVideoUpdatePrivacyValid, | 226 | isScheduleVideoUpdatePrivacyValid, |
227 | isVideoOriginallyPublishedAtValid, | ||
223 | isVideoFile, | 228 | isVideoFile, |
224 | isVideoMagnetUriValid, | 229 | isVideoMagnetUriValid, |
225 | isVideoStateValid, | 230 | isVideoStateValid, |