Fix autoblacklist notification issue
This commit is contained in:
parent
4948dcdbeb
commit
f0484f7a16
|
@ -1,4 +1,5 @@
|
||||||
import { Transaction } from 'sequelize'
|
import { Transaction } from 'sequelize'
|
||||||
|
import { afterCommitIfTransaction } from '@server/helpers/database-utils'
|
||||||
import { sequelizeTypescript } from '@server/initializers/database'
|
import { sequelizeTypescript } from '@server/initializers/database'
|
||||||
import {
|
import {
|
||||||
MUser,
|
MUser,
|
||||||
|
@ -15,9 +16,9 @@ import { CONFIG } from '../initializers/config'
|
||||||
import { VideoBlacklistModel } from '../models/video/video-blacklist'
|
import { VideoBlacklistModel } from '../models/video/video-blacklist'
|
||||||
import { sendDeleteVideo } from './activitypub/send'
|
import { sendDeleteVideo } from './activitypub/send'
|
||||||
import { federateVideoIfNeeded } from './activitypub/videos'
|
import { federateVideoIfNeeded } from './activitypub/videos'
|
||||||
|
import { LiveManager } from './live-manager'
|
||||||
import { Notifier } from './notifier'
|
import { Notifier } from './notifier'
|
||||||
import { Hooks } from './plugins/hooks'
|
import { Hooks } from './plugins/hooks'
|
||||||
import { LiveManager } from './live-manager'
|
|
||||||
|
|
||||||
async function autoBlacklistVideoIfNeeded (parameters: {
|
async function autoBlacklistVideoIfNeeded (parameters: {
|
||||||
video: MVideoWithBlacklistLight
|
video: MVideoWithBlacklistLight
|
||||||
|
@ -53,7 +54,11 @@ async function autoBlacklistVideoIfNeeded (parameters: {
|
||||||
|
|
||||||
videoBlacklist.Video = video
|
videoBlacklist.Video = video
|
||||||
|
|
||||||
if (notify) Notifier.Instance.notifyOnVideoAutoBlacklist(videoBlacklist)
|
if (notify) {
|
||||||
|
afterCommitIfTransaction(transaction, () => {
|
||||||
|
Notifier.Instance.notifyOnVideoAutoBlacklist(videoBlacklist)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
logger.info('Video %s auto-blacklisted.', video.uuid)
|
logger.info('Video %s auto-blacklisted.', video.uuid)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue