diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-14 10:57:56 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:51 +0100 |
commit | e34c85e527100c0b5c44567bd951e95be41b8d7e (patch) | |
tree | 39697c5a4dda2c2e07142a8522538db783fce2fd /server/helpers/custom-validators/videos.ts | |
parent | 1e1265b36c09df1465aa2b4866815c957b6a532e (diff) | |
download | PeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.tar.gz PeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.tar.zst PeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.zip |
Fix issues on server start
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 | } |