From 51353d9a035fb6b81f903a8b5f391292841649fd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 9 Nov 2021 10:11:20 +0100 Subject: Refactor video views Introduce viewers attribute for live videos Count views for live videos Reduce delay to see the viewer update for lives Add ability to configure video views buffer interval and view ip expiration --- server/lib/activitypub/send/send-view.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/lib/activitypub/send') diff --git a/server/lib/activitypub/send/send-view.ts b/server/lib/activitypub/send/send-view.ts index 153e94295..b12583e26 100644 --- a/server/lib/activitypub/send/send-view.ts +++ b/server/lib/activitypub/send/send-view.ts @@ -1,4 +1,5 @@ import { Transaction } from 'sequelize' +import { VideoViews } from '@server/lib/video-views' import { MActorAudience, MVideoImmutable, MVideoUrl } from '@server/types/models' import { ActivityAudience, ActivityView } from '../../../../shared/models/activitypub' import { logger } from '../../../helpers/logger' @@ -27,7 +28,8 @@ function buildViewActivity (url: string, byActor: MActorAudience, video: MVideoU id: url, type: 'View' as 'View', actor: byActor.url, - object: video.url + object: video.url, + expires: new Date(VideoViews.Instance.buildViewerExpireTime()).toISOString() }, audience ) -- cgit v1.2.3