aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r--server/helpers/custom-validators/videos.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts
index 487b3d646..715119cf6 100644
--- a/server/helpers/custom-validators/videos.ts
+++ b/server/helpers/custom-validators/videos.ts
@@ -19,6 +19,7 @@ import { isArray, exists } from './misc'
19import { VideoInstance } from '../../models' 19import { VideoInstance } from '../../models'
20import { logger } from '../../helpers' 20import { logger } from '../../helpers'
21import { VideoRateType } from '../../../shared' 21import { VideoRateType } from '../../../shared'
22import { isActivityPubUrlValid } from './activitypub/misc'
22 23
23const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS 24const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS
24const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES 25const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES
@@ -33,6 +34,10 @@ function isRemoteVideoCategoryValid (value: string) {
33 return validator.isInt('' + value) 34 return validator.isInt('' + value)
34} 35}
35 36
37function isVideoUrlValid (value: string) {
38 return isActivityPubUrlValid(value)
39}
40
36function isVideoLicenceValid (value: number) { 41function isVideoLicenceValid (value: number) {
37 return VIDEO_LICENCES[value] !== undefined 42 return VIDEO_LICENCES[value] !== undefined
38} 43}
@@ -219,5 +224,6 @@ export {
219 isVideoTagValid, 224 isVideoTagValid,
220 isRemoteVideoCategoryValid, 225 isRemoteVideoCategoryValid,
221 isRemoteVideoLicenceValid, 226 isRemoteVideoLicenceValid,
227 isVideoUrlValid,
222 isRemoteVideoLanguageValid 228 isRemoteVideoLanguageValid
223} 229}