diff options
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 6 |
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' | |||
19 | import { VideoInstance } from '../../models' | 19 | import { VideoInstance } from '../../models' |
20 | import { logger } from '../../helpers' | 20 | import { logger } from '../../helpers' |
21 | import { VideoRateType } from '../../../shared' | 21 | import { VideoRateType } from '../../../shared' |
22 | import { isActivityPubUrlValid } from './activitypub/misc' | ||
22 | 23 | ||
23 | const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS | 24 | const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS |
24 | const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES | 25 | const 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 | ||
37 | function isVideoUrlValid (value: string) { | ||
38 | return isActivityPubUrlValid(value) | ||
39 | } | ||
40 | |||
36 | function isVideoLicenceValid (value: number) { | 41 | function 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 | } |