diff options
author | Chocobozzz <me@florianbigard.com> | 2021-01-04 10:50:47 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-01-04 10:50:47 +0100 |
commit | f0484f7a16ba8d14f8ce788398467307f4d23e1d (patch) | |
tree | fa5c8bc62c9a6aabba816693cf3a21b60c177e12 /server | |
parent | 4948dcdbeb4b097770167b50f2bddade6ae88370 (diff) | |
download | PeerTube-f0484f7a16ba8d14f8ce788398467307f4d23e1d.tar.gz PeerTube-f0484f7a16ba8d14f8ce788398467307f4d23e1d.tar.zst PeerTube-f0484f7a16ba8d14f8ce788398467307f4d23e1d.zip |
Fix autoblacklist notification issue
Diffstat (limited to 'server')
-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 | ||