X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fvideo-blacklist.ts;h=f6c66b6dd8a658d3391440927f0c3537c64aa6c6;hb=884d2c39ae23b44d0d037aaff0f66ad9ae0807ba;hp=1ee92d22c61ea6faa39f3c7598f861f513feb234;hpb=3487330d308166afb542cbacae0475693c0b059e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/video-blacklist.ts b/server/lib/video-blacklist.ts index 1ee92d22c..f6c66b6dd 100644 --- a/server/lib/video-blacklist.ts +++ b/server/lib/video-blacklist.ts @@ -7,7 +7,7 @@ import { MVideoBlacklistVideo, MVideoFullLight, MVideoWithBlacklistLight -} from '@server/typings/models' +} from '@server/types/models' import { UserRight, VideoBlacklistCreate, VideoBlacklistType } from '../../shared/models' import { UserAdminFlag } from '../../shared/models/users/user-flag.model' import { logger } from '../helpers/logger' @@ -17,6 +17,7 @@ import { sendDeleteVideo } from './activitypub/send' import { federateVideoIfNeeded } from './activitypub/videos' import { Notifier } from './notifier' import { Hooks } from './plugins/hooks' +import { LiveManager } from './live-manager' async function autoBlacklistVideoIfNeeded (parameters: { video: MVideoWithBlacklistLight @@ -73,6 +74,10 @@ async function blacklistVideo (videoInstance: MVideoAccountLight, options: Video await sendDeleteVideo(videoInstance, undefined) } + if (videoInstance.isLive) { + LiveManager.Instance.stopSessionOf(videoInstance.id) + } + Notifier.Instance.notifyOnVideoBlacklist(blacklist) }