-async function autoBlacklistVideoIfNeeded (video: VideoModel, user: UserModel, transaction: sequelize.Transaction) {
- if (!CONFIG.AUTO_BLACKLIST.VIDEOS.OF_USERS.ENABLED) return false
+async function autoBlacklistVideoIfNeeded (parameters: {
+ video: MVideoWithBlacklistLight
+ user?: MUser
+ isRemote: boolean
+ isNew: boolean
+ notify?: boolean
+ transaction?: Transaction
+}) {
+ const { video, user, isRemote, isNew, notify = true, transaction } = parameters
+ const doAutoBlacklist = await Hooks.wrapFun(
+ autoBlacklistNeeded,
+ { video, user, isRemote, isNew },
+ 'filter:video.auto-blacklist.result'
+ )