X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fvideo-blacklist.ts;h=fd5837a3a19bd394611586dc07142722beb7fe4c;hb=b34ee7fa5f6558bd6fb870756ace1cd12e40e94c;hp=dbb37e0b28b70915c87615c4118066ba04770fbc;hpb=f0484f7a16ba8d14f8ce788398467307f4d23e1d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/video-blacklist.ts b/server/lib/video-blacklist.ts index dbb37e0b2..fd5837a3a 100644 --- a/server/lib/video-blacklist.ts +++ b/server/lib/video-blacklist.ts @@ -9,17 +9,19 @@ import { MVideoFullLight, MVideoWithBlacklistLight } from '@server/types/models' -import { UserRight, VideoBlacklistCreate, VideoBlacklistType } from '../../shared/models' +import { LiveVideoError, UserRight, VideoBlacklistCreate, VideoBlacklistType } from '../../shared/models' import { UserAdminFlag } from '../../shared/models/users/user-flag.model' -import { logger } from '../helpers/logger' +import { logger, loggerTagsFactory } from '../helpers/logger' import { CONFIG } from '../initializers/config' import { VideoBlacklistModel } from '../models/video/video-blacklist' import { sendDeleteVideo } from './activitypub/send' import { federateVideoIfNeeded } from './activitypub/videos' -import { LiveManager } from './live-manager' +import { LiveManager } from './live/live-manager' import { Notifier } from './notifier' import { Hooks } from './plugins/hooks' +const lTags = loggerTagsFactory('blacklist') + async function autoBlacklistVideoIfNeeded (parameters: { video: MVideoWithBlacklistLight user?: MUser @@ -60,7 +62,7 @@ async function autoBlacklistVideoIfNeeded (parameters: { }) } - logger.info('Video %s auto-blacklisted.', video.uuid) + logger.info('Video %s auto-blacklisted.', video.uuid, lTags(video.uuid)) return true } @@ -71,8 +73,7 @@ async function blacklistVideo (videoInstance: MVideoAccountLight, options: Video unfederated: options.unfederate === true, reason: options.reason, type: VideoBlacklistType.MANUAL - } - ) + }) blacklist.Video = videoInstance if (options.unfederate === true) { @@ -80,7 +81,7 @@ async function blacklistVideo (videoInstance: MVideoAccountLight, options: Video } if (videoInstance.isLive) { - LiveManager.Instance.stopSessionOf(videoInstance.id) + LiveManager.Instance.stopSessionOf(videoInstance.id, LiveVideoError.BLACKLISTED) } Notifier.Instance.notifyOnVideoBlacklist(blacklist)