]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/video-blacklist.ts
Translated using Weblate (Toki Pona (tok))
[github/Chocobozzz/PeerTube.git] / server / lib / video-blacklist.ts
index dbb37e0b28b70915c87615c4118066ba04770fbc..fd5837a3a19bd394611586dc07142722beb7fe4c 100644 (file)
@@ -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)