X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fvideo-blacklist.ts;h=34fcec38e341ee1584836c21c6b48860fc274f67;hb=f2eb23cd87cf32b8fe545178143b5f49e06a58da;hp=de6726b8f993226221bcab283d129fb180711aff;hpb=5baee5fca418487e72ddcd6419d31bca8659b668;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/video-blacklist.ts b/server/helpers/custom-validators/video-blacklist.ts index de6726b8f..34fcec38e 100644 --- a/server/helpers/custom-validators/video-blacklist.ts +++ b/server/helpers/custom-validators/video-blacklist.ts @@ -1,7 +1,7 @@ import validator from 'validator' import { exists } from './misc' import { CONSTRAINTS_FIELDS } from '../../initializers/constants' -import { VideoBlockType } from '../../../shared/models/videos' +import { VideoBlacklistType } from '../../../shared/models/videos' const VIDEO_BLACKLIST_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_BLACKLIST @@ -10,7 +10,8 @@ function isVideoBlacklistReasonValid (value: string) { } function isVideoBlacklistTypeValid (value: any) { - return exists(value) && validator.isInt('' + value) && VideoBlockType[value] !== undefined + return exists(value) && + (value === VideoBlacklistType.AUTO_BEFORE_PUBLISHED || value === VideoBlacklistType.MANUAL) } // ---------------------------------------------------------------------------