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'
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: {
videoId: videoInstance.id,
unfederated: options.unfederate === true,
reason: options.reason,
- type: VideoBlockType.MANUAL
+ type: VideoBlacklistType.MANUAL
}
)
blacklist.Video = videoInstance
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
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
}