]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/video-blacklist.ts
Fix peertube subtitles import
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / video-blacklist.ts
index 9a44332ef2eefdec8498ce1614fa2a702a21a829..34fcec38e341ee1584836c21c6b48860fc274f67 100644 (file)
@@ -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)
 }
 
 // ---------------------------------------------------------------------------