-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'
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)
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) {