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 --- shared/models/videos/live/live-video-event-payload.model.ts | 4 ++++ shared/models/videos/video.model.ts | 3 +++ 2 files changed, 7 insertions(+) (limited to 'shared/models/videos') diff --git a/shared/models/videos/live/live-video-event-payload.model.ts b/shared/models/videos/live/live-video-event-payload.model.ts index 6cd7540e8..1a9ac512c 100644 --- a/shared/models/videos/live/live-video-event-payload.model.ts +++ b/shared/models/videos/live/live-video-event-payload.model.ts @@ -2,5 +2,9 @@ import { VideoState } from '../video-state.enum' export interface LiveVideoEventPayload { state?: VideoState + + // FIXME: deprecated in 4.0 in favour of viewers views?: number + + viewers?: number } diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts index 26cb595e7..8d223cded 100644 --- a/shared/models/videos/video.model.ts +++ b/shared/models/videos/video.model.ts @@ -39,6 +39,9 @@ export interface Video { url: string views: number + // If live + viewers?: number + likes: number dislikes: number nsfw: boolean -- cgit v1.2.3