From 8424c4026afd7304880a4ce8138a04ffb3d8c938 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 30 Aug 2019 16:50:12 +0200 Subject: Add auto follow back support for instances --- server/lib/video-blacklist.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server/lib/video-blacklist.ts') diff --git a/server/lib/video-blacklist.ts b/server/lib/video-blacklist.ts index a0fc26e84..1dd45b76d 100644 --- a/server/lib/video-blacklist.ts +++ b/server/lib/video-blacklist.ts @@ -6,7 +6,7 @@ import { logger } from '../helpers/logger' import { UserAdminFlag } from '../../shared/models/users/user-flag.model' import { Hooks } from './plugins/hooks' import { Notifier } from './notifier' -import { MUser, MVideoBlacklist, MVideoWithBlacklistLight } from '@server/typings/models' +import { MUser, MVideoBlacklistVideo, MVideoWithBlacklistLight } from '@server/typings/models' async function autoBlacklistVideoIfNeeded (parameters: { video: MVideoWithBlacklistLight, @@ -31,7 +31,7 @@ async function autoBlacklistVideoIfNeeded (parameters: { reason: 'Auto-blacklisted. Moderator review required.', type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED } - const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate({ + const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate({ where: { videoId: video.id }, @@ -40,7 +40,9 @@ async function autoBlacklistVideoIfNeeded (parameters: { }) video.VideoBlacklist = videoBlacklist - if (notify) Notifier.Instance.notifyOnVideoAutoBlacklist(video) + videoBlacklist.Video = video + + if (notify) Notifier.Instance.notifyOnVideoAutoBlacklist(videoBlacklist) logger.info('Video %s auto-blacklisted.', video.uuid) -- cgit v1.2.3