aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video-blacklist.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/video-blacklist.ts')
-rw-r--r--server/lib/video-blacklist.ts8
1 files changed, 5 insertions, 3 deletions
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'
6import { UserAdminFlag } from '../../shared/models/users/user-flag.model' 6import { UserAdminFlag } from '../../shared/models/users/user-flag.model'
7import { Hooks } from './plugins/hooks' 7import { Hooks } from './plugins/hooks'
8import { Notifier } from './notifier' 8import { Notifier } from './notifier'
9import { MUser, MVideoBlacklist, MVideoWithBlacklistLight } from '@server/typings/models' 9import { MUser, MVideoBlacklistVideo, MVideoWithBlacklistLight } from '@server/typings/models'
10 10
11async function autoBlacklistVideoIfNeeded (parameters: { 11async function autoBlacklistVideoIfNeeded (parameters: {
12 video: MVideoWithBlacklistLight, 12 video: MVideoWithBlacklistLight,
@@ -31,7 +31,7 @@ async function autoBlacklistVideoIfNeeded (parameters: {
31 reason: 'Auto-blacklisted. Moderator review required.', 31 reason: 'Auto-blacklisted. Moderator review required.',
32 type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED 32 type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
33 } 33 }
34 const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate<MVideoBlacklist>({ 34 const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate<MVideoBlacklistVideo>({
35 where: { 35 where: {
36 videoId: video.id 36 videoId: video.id
37 }, 37 },
@@ -40,7 +40,9 @@ async function autoBlacklistVideoIfNeeded (parameters: {
40 }) 40 })
41 video.VideoBlacklist = videoBlacklist 41 video.VideoBlacklist = videoBlacklist
42 42
43 if (notify) Notifier.Instance.notifyOnVideoAutoBlacklist(video) 43 videoBlacklist.Video = video
44
45 if (notify) Notifier.Instance.notifyOnVideoAutoBlacklist(videoBlacklist)
44 46
45 logger.info('Video %s auto-blacklisted.', video.uuid) 47 logger.info('Video %s auto-blacklisted.', video.uuid)
46 48