X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Fsend%2Fsend-create.ts;h=baded642acb1d41ac1a4e73bf5c26e2dfa791670;hb=4d7ce9218a3f695bf3d013cbdce1c5c6a5221927;hp=0635c7b661198a8989084855aae4528549d505aa;hpb=8dc8a34ee8428e7657414115d1c137592efa174d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/send/send-create.ts b/server/lib/activitypub/send/send-create.ts index 0635c7b66..baded642a 100644 --- a/server/lib/activitypub/send/send-create.ts +++ b/server/lib/activitypub/send/send-create.ts @@ -4,7 +4,7 @@ import { VideoPrivacy } from '../../../../shared/models/videos' import { VideoCommentModel } from '../../../models/video/video-comment' import { broadcastToActors, broadcastToFollowers, sendVideoRelatedActivity, unicastTo } from './utils' import { audiencify, getActorsInvolvedInVideo, getAudience, getAudienceFromFollowersOf, getVideoCommentAudience } from '../audience' -import { logger } from '../../../helpers/logger' +import { logger, loggerTagsFactory } from '../../../helpers/logger' import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' import { MActorLight, @@ -14,14 +14,16 @@ import { MVideoPlaylistFull, MVideoRedundancyFileVideo, MVideoRedundancyStreamingPlaylistVideo -} from '../../../typings/models' -import { ContextType } from '@server/helpers/activitypub' +} from '../../../types/models' import { getServerActor } from '@server/models/application/application' +import { ContextType } from '@shared/models/activitypub/context' + +const lTags = loggerTagsFactory('ap', 'create') async function sendCreateVideo (video: MVideoAP, t: Transaction) { if (!video.hasPrivacyForFederation()) return undefined - logger.info('Creating job to send video creation of %s.', video.url) + logger.info('Creating job to send video creation of %s.', video.url, lTags(video.uuid)) const byActor = video.VideoChannel.Account.Actor const videoObject = video.toActivityPubObject() @@ -37,7 +39,7 @@ async function sendCreateCacheFile ( video: MVideoAccountLight, fileRedundancy: MVideoRedundancyStreamingPlaylistVideo | MVideoRedundancyFileVideo ) { - logger.info('Creating job to send file cache of %s.', fileRedundancy.url) + logger.info('Creating job to send file cache of %s.', fileRedundancy.url, lTags(video.uuid)) return sendVideoRelatedCreateActivity({ byActor, @@ -51,7 +53,7 @@ async function sendCreateCacheFile ( async function sendCreateVideoPlaylist (playlist: MVideoPlaylistFull, t: Transaction) { if (playlist.privacy === VideoPlaylistPrivacy.PRIVATE) return undefined - logger.info('Creating job to send create video playlist of %s.', playlist.url) + logger.info('Creating job to send create video playlist of %s.', playlist.url, lTags(playlist.uuid)) const byActor = playlist.OwnerAccount.Actor const audience = getAudience(byActor, playlist.privacy === VideoPlaylistPrivacy.PUBLIC)