X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fvideos.ts;h=5e6cfe2176a8e96a8938d15b253f02218fffd4d0;hb=06a05d5f4784a7cbb27aa1188385b5679845dad8;hp=f4c1c8b0720d5f1944ed8f59f0c3ddf16a5515de;hpb=ce33919c24e7402d92d81f3cd8e545df52d98240;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index f4c1c8b07..5e6cfe217 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts @@ -6,6 +6,7 @@ import * as validator from 'validator' import { UserRight, VideoPrivacy, VideoRateType } from '../../../shared' import { CONSTRAINTS_FIELDS, + VIDEO_ABUSE_STATES, VIDEO_CATEGORIES, VIDEO_LICENCES, VIDEO_MIMETYPE_EXT, @@ -18,6 +19,7 @@ import { exists, isArray, isFileValid } from './misc' import { VideoChannelModel } from '../../models/video/video-channel' import { UserModel } from '../../models/account/user' import * as magnetUtil from 'magnet-uri' +import { VideoAbuseModel } from '../../models/video/video-abuse' const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES @@ -71,10 +73,6 @@ function isVideoTagsValid (tags: string[]) { ) } -function isVideoAbuseReasonValid (value: string) { - return exists(value) && validator.isLength(value, VIDEO_ABUSES_CONSTRAINTS_FIELDS.REASON) -} - function isVideoViewsValid (value: string) { return exists(value) && validator.isInt(value + '', VIDEOS_CONSTRAINTS_FIELDS.VIEWS) } @@ -220,7 +218,6 @@ export { isVideoTagsValid, isVideoFPSResolutionValid, isScheduleVideoUpdatePrivacyValid, - isVideoAbuseReasonValid, isVideoFile, isVideoMagnetUriValid, isVideoStateValid,