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 --- client/src/app/shared/shared-main/video/video.model.ts | 4 ++++ client/src/app/shared/shared-video/video-views-counter.component.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts index b11316471..472a8c810 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts @@ -57,6 +57,9 @@ export class Video implements VideoServerModel { url: string views: number + // If live + viewers?: number + likes: number dislikes: number nsfw: boolean @@ -150,6 +153,7 @@ export class Video implements VideoServerModel { this.url = hash.url this.views = hash.views + this.viewers = hash.viewers this.likes = hash.likes this.dislikes = hash.dislikes diff --git a/client/src/app/shared/shared-video/video-views-counter.component.html b/client/src/app/shared/shared-video/video-views-counter.component.html index a6679f74d..b19c8b137 100644 --- a/client/src/app/shared/shared-video/video-views-counter.component.html +++ b/client/src/app/shared/shared-video/video-views-counter.component.html @@ -4,6 +4,6 @@ - {video.views, plural, =1 {1 viewer} other {{{ video.views | myNumberFormatter }} viewers}} + {video.viewers, plural, =1 {1 viewer} other {{{ video.viewers | myNumberFormatter }} viewers}} -- cgit v1.2.3