aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/lib/video-blacklist.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/server/lib/video-blacklist.ts b/server/lib/video-blacklist.ts
index f6c66b6dd..dbb37e0b2 100644
--- a/server/lib/video-blacklist.ts
+++ b/server/lib/video-blacklist.ts
@@ -1,4 +1,5 @@
1import { Transaction } from 'sequelize' 1import { Transaction } from 'sequelize'
2import { afterCommitIfTransaction } from '@server/helpers/database-utils'
2import { sequelizeTypescript } from '@server/initializers/database' 3import { sequelizeTypescript } from '@server/initializers/database'
3import { 4import {
4 MUser, 5 MUser,
@@ -15,9 +16,9 @@ import { CONFIG } from '../initializers/config'
15import { VideoBlacklistModel } from '../models/video/video-blacklist' 16import { VideoBlacklistModel } from '../models/video/video-blacklist'
16import { sendDeleteVideo } from './activitypub/send' 17import { sendDeleteVideo } from './activitypub/send'
17import { federateVideoIfNeeded } from './activitypub/videos' 18import { federateVideoIfNeeded } from './activitypub/videos'
19import { LiveManager } from './live-manager'
18import { Notifier } from './notifier' 20import { Notifier } from './notifier'
19import { Hooks } from './plugins/hooks' 21import { Hooks } from './plugins/hooks'
20import { LiveManager } from './live-manager'
21 22
22async function autoBlacklistVideoIfNeeded (parameters: { 23async function autoBlacklistVideoIfNeeded (parameters: {
23 video: MVideoWithBlacklistLight 24 video: MVideoWithBlacklistLight
@@ -53,7 +54,11 @@ async function autoBlacklistVideoIfNeeded (parameters: {
53 54
54 videoBlacklist.Video = video 55 videoBlacklist.Video = video
55 56
56 if (notify) Notifier.Instance.notifyOnVideoAutoBlacklist(videoBlacklist) 57 if (notify) {
58 afterCommitIfTransaction(transaction, () => {
59 Notifier.Instance.notifyOnVideoAutoBlacklist(videoBlacklist)
60 })
61 }
57 62
58 logger.info('Video %s auto-blacklisted.', video.uuid) 63 logger.info('Video %s auto-blacklisted.', video.uuid)
59 64