1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Add tags to logs in AP videos

This commit is contained in:
Chocobozzz 2021-06-02 16:49:59 +02:00
parent e872632091
commit 463206948d
No known key found for this signature in database
GPG key ID: 583A612D890159BE
7 changed files with 46 additions and 25 deletions

View file

@ -1,7 +1,7 @@
import { Transaction } from 'sequelize/types'
import { checkUrlsSameHost } from '@server/helpers/activitypub'
import { deleteNonExistingModels } from '@server/helpers/database-utils'
import { logger } from '@server/helpers/logger'
import { logger, LoggerTagsFn } from '@server/helpers/logger'
import { createPlaceholderThumbnail, createVideoMiniatureFromUrl } from '@server/lib/thumbnail'
import { setVideoTags } from '@server/lib/video'
import { VideoCaptionModel } from '@server/models/video/video-caption'
@ -24,6 +24,7 @@ import { getTrackerUrls, setVideoTrackers } from './trackers'
export abstract class APVideoAbstractBuilder {
protected abstract videoObject: VideoObject
protected abstract lTags: LoggerTagsFn
protected async getOrCreateVideoChannelFromVideoObject () {
const channel = this.videoObject.attributedTo.find(a => a.type === 'Group')
@ -42,7 +43,7 @@ export abstract class APVideoAbstractBuilder {
video,
type: ThumbnailType.MINIATURE
}).catch(err => {
logger.warn('Cannot generate thumbnail of %s.', this.videoObject.id, { err })
logger.warn('Cannot generate thumbnail of %s.', this.videoObject.id, { err, ...this.lTags(video.uuid) })
return undefined
})