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