]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/video-blacklist.ts
preserve original variable names server-side
[github/Chocobozzz/PeerTube.git] / server / lib / video-blacklist.ts
index f1657e8f1dd509133ad1ea210e47824745b0b075..1ee92d22c61ea6faa39f3c7598f861f513feb234 100644 (file)
@@ -8,7 +8,7 @@ import {
   MVideoFullLight,
   MVideoWithBlacklistLight
 } from '@server/typings/models'
-import { UserRight, VideoBlacklistCreate, VideoBlockType } from '../../shared/models'
+import { UserRight, VideoBlacklistCreate, VideoBlacklistType } from '../../shared/models'
 import { UserAdminFlag } from '../../shared/models/users/user-flag.model'
 import { logger } from '../helpers/logger'
 import { CONFIG } from '../initializers/config'
@@ -39,7 +39,7 @@ async function autoBlacklistVideoIfNeeded (parameters: {
     videoId: video.id,
     unfederated: true,
     reason: 'Auto-blacklisted. Moderator review required.',
-    type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+    type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
   }
   const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate<MVideoBlacklistVideo>({
     where: {
@@ -64,7 +64,7 @@ async function blacklistVideo (videoInstance: MVideoAccountLight, options: Video
     videoId: videoInstance.id,
     unfederated: options.unfederate === true,
     reason: options.reason,
-    type: VideoBlockType.MANUAL
+    type: VideoBlacklistType.MANUAL
   }
   )
   blacklist.Video = videoInstance
@@ -94,7 +94,7 @@ async function unblacklistVideo (videoBlacklist: MVideoBlacklist, video: MVideoF
 
   Notifier.Instance.notifyOnVideoUnblacklist(video)
 
-  if (videoBlacklistType === VideoBlockType.AUTO_BEFORE_PUBLISHED) {
+  if (videoBlacklistType === VideoBlacklistType.AUTO_BEFORE_PUBLISHED) {
     Notifier.Instance.notifyOnVideoPublishedAfterRemovedFromAutoBlacklist(video)
 
     // Delete on object so new video notifications will send
@@ -126,7 +126,7 @@ function autoBlacklistNeeded (parameters: {
   if (!CONFIG.AUTO_BLACKLIST.VIDEOS.OF_USERS.ENABLED || !user) return false
   if (isRemote || isNew === false) return false
 
-  if (user.hasRight(UserRight.MANAGE_VIDEO_BLOCKS) || user.hasAdminFlag(UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK)) return false
+  if (user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) || user.hasAdminFlag(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST)) return false
 
   return true
 }