From e34c85e527100c0b5c44567bd951e95be41b8d7e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 14 Nov 2017 10:57:56 +0100 Subject: Fix issues on server start --- server/helpers/custom-validators/videos.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server/helpers/custom-validators/videos.ts') 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' import { VideoInstance } from '../../models' import { logger } from '../../helpers' import { VideoRateType } from '../../../shared' +import { isActivityPubUrlValid } from './activitypub/misc' const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES @@ -33,6 +34,10 @@ function isRemoteVideoCategoryValid (value: string) { return validator.isInt('' + value) } +function isVideoUrlValid (value: string) { + return isActivityPubUrlValid(value) +} + function isVideoLicenceValid (value: number) { return VIDEO_LICENCES[value] !== undefined } @@ -219,5 +224,6 @@ export { isVideoTagValid, isRemoteVideoCategoryValid, isRemoteVideoLicenceValid, + isVideoUrlValid, isRemoteVideoLanguageValid } -- cgit v1.2.3