1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Optimize broadcast job creation

This commit is contained in:
Chocobozzz 2022-06-17 10:49:37 +02:00
parent b9e49a45f5
commit 3396e65345
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 49 additions and 62 deletions

View file

@ -19,13 +19,13 @@ async function sendVideoRelatedActivity (activityBuilder: (audience: ActivityAud
}) {
const { byActor, video, transaction, contextType } = options
const actorsInvolvedInVideo = await getActorsInvolvedInVideo(video, transaction)
// Send to origin
if (video.isOwned() === false) {
return sendVideoActivityToOrigin(activityBuilder, options)
}
const actorsInvolvedInVideo = await getActorsInvolvedInVideo(video, transaction)
// Send to followers
const audience = getAudienceFromFollowersOf(actorsInvolvedInVideo)
const activity = activityBuilder(audience)