diff options
-rw-r--r-- | server/lib/video-blacklist.ts | 9 |
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 @@ | |||
1 | import { Transaction } from 'sequelize' | 1 | import { Transaction } from 'sequelize' |
2 | import { afterCommitIfTransaction } from '@server/helpers/database-utils' | ||
2 | import { sequelizeTypescript } from '@server/initializers/database' | 3 | import { sequelizeTypescript } from '@server/initializers/database' |
3 | import { | 4 | import { |
4 | MUser, | 5 | MUser, |
@@ -15,9 +16,9 @@ import { CONFIG } from '../initializers/config' | |||
15 | import { VideoBlacklistModel } from '../models/video/video-blacklist' | 16 | import { VideoBlacklistModel } from '../models/video/video-blacklist' |
16 | import { sendDeleteVideo } from './activitypub/send' | 17 | import { sendDeleteVideo } from './activitypub/send' |
17 | import { federateVideoIfNeeded } from './activitypub/videos' | 18 | import { federateVideoIfNeeded } from './activitypub/videos' |
19 | import { LiveManager } from './live-manager' | ||
18 | import { Notifier } from './notifier' | 20 | import { Notifier } from './notifier' |
19 | import { Hooks } from './plugins/hooks' | 21 | import { Hooks } from './plugins/hooks' |
20 | import { LiveManager } from './live-manager' | ||
21 | 22 | ||
22 | async function autoBlacklistVideoIfNeeded (parameters: { | 23 | async 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 | ||