]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/videos/shared/creator.ts
Fix user subscription follows count
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / videos / shared / creator.ts
index dd9bfb508528a6a6437738b478cd6a3afb02882a..ad3b889364ad40c56e640582ac955629f5a35c72 100644 (file)
@@ -1,5 +1,5 @@
 
-import { logger } from '@server/helpers/logger'
+import { logger, loggerTagsFactory, LoggerTagsFn } from '@server/helpers/logger'
 import { sequelizeTypescript } from '@server/initializers/database'
 import { autoBlacklistVideoIfNeeded } from '@server/lib/video-blacklist'
 import { VideoModel } from '@server/models/video/video'
@@ -9,18 +9,21 @@ import { APVideoAbstractBuilder } from './abstract-builder'
 import { getVideoAttributesFromObject } from './object-to-model-attributes'
 
 export class APVideoCreator extends APVideoAbstractBuilder {
+  protected lTags: LoggerTagsFn
 
   constructor (protected readonly videoObject: VideoObject) {
     super()
+
+    this.lTags = loggerTagsFactory('ap', 'video', 'create', this.videoObject.uuid, this.videoObject.id)
   }
 
   async create (waitThumbnail = false) {
-    logger.debug('Adding remote video %s.', this.videoObject.id)
+    logger.debug('Adding remote video %s.', this.videoObject.id, this.lTags())
 
     const channelActor = await this.getOrCreateVideoChannelFromVideoObject()
     const channel = channelActor.VideoChannel
 
-    const videoData = await getVideoAttributesFromObject(channel, this.videoObject, this.videoObject.to)
+    const videoData = getVideoAttributesFromObject(channel, this.videoObject, this.videoObject.to)
     const video = VideoModel.build(videoData) as MVideoThumbnail
 
     const promiseThumbnail = this.tryToGenerateThumbnail(video)
@@ -56,7 +59,7 @@ export class APVideoCreator extends APVideoAbstractBuilder {
           transaction: t
         })
 
-        logger.info('Remote video with uuid %s inserted.', this.videoObject.uuid)
+        logger.info('Remote video with uuid %s inserted.', this.videoObject.uuid, this.lTags())
 
         return { autoBlacklisted, videoCreated }
       } catch (err) {