aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/send
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-04-06 08:50:43 +0200
committerChocobozzz <chocobozzz@cpy.re>2022-04-15 09:49:35 +0200
commitac907dc7c158056e9b6a5cb58acd27df5c7c2670 (patch)
treef9d8bff22e0543a305c64e1a1808c0df6d512f1e /server/lib/activitypub/send
parentdfbcefc20dc64f0814b1f2e8e782a4ea1bd24db2 (diff)
downloadPeerTube-ac907dc7c158056e9b6a5cb58acd27df5c7c2670.tar.gz
PeerTube-ac907dc7c158056e9b6a5cb58acd27df5c7c2670.tar.zst
PeerTube-ac907dc7c158056e9b6a5cb58acd27df5c7c2670.zip
Improve viewer counter
More precise, avoid weird decrease, reuse an id to federate viewers
Diffstat (limited to 'server/lib/activitypub/send')
-rw-r--r--server/lib/activitypub/send/send-view.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/activitypub/send/send-view.ts b/server/lib/activitypub/send/send-view.ts
index 1088bf258..25a20ec6d 100644
--- a/server/lib/activitypub/send/send-view.ts
+++ b/server/lib/activitypub/send/send-view.ts
@@ -13,14 +13,15 @@ async function sendView (options: {
13 byActor: MActorLight 13 byActor: MActorLight
14 type: ViewType 14 type: ViewType
15 video: MVideoImmutable 15 video: MVideoImmutable
16 viewerIdentifier: string
16 transaction?: Transaction 17 transaction?: Transaction
17}) { 18}) {
18 const { byActor, type, video, transaction } = options 19 const { byActor, type, video, viewerIdentifier, transaction } = options
19 20
20 logger.info('Creating job to send %s of %s.', type, video.url) 21 logger.info('Creating job to send %s of %s.', type, video.url)
21 22
22 const activityBuilder = (audience: ActivityAudience) => { 23 const activityBuilder = (audience: ActivityAudience) => {
23 const url = getLocalVideoViewActivityPubUrl(byActor, video) 24 const url = getLocalVideoViewActivityPubUrl(byActor, video, viewerIdentifier)
24 25
25 return buildViewActivity({ url, byActor, video, audience, type }) 26 return buildViewActivity({ url, byActor, video, audience, type })
26 } 27 }