From 305ec384966303bbcedb72b905c5ec4f32d9c7ad Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 May 2022 09:18:39 +0200 Subject: [PATCH] Add total viewers overall stat --- client/src/app/+stats/video/video-stats.component.scss | 5 +++++ client/src/app/+stats/video/video-stats.component.ts | 6 +++++- server/models/view/local-video-viewer.ts | 5 +++++ server/tests/api/views/video-views-overall-stats.ts | 10 ++++++++++ .../models/videos/stats/video-stats-overall.model.ts | 2 ++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/client/src/app/+stats/video/video-stats.component.scss b/client/src/app/+stats/video/video-stats.component.scss index e4c2d899f..5733b3286 100644 --- a/client/src/app/+stats/video/video-stats.component.scss +++ b/client/src/app/+stats/video/video-stats.component.scss @@ -23,6 +23,11 @@ .cards { display: flex; + flex-wrap: wrap; + } + + .date-filter-wrapper { + margin-bottom: 10px; } } diff --git a/client/src/app/+stats/video/video-stats.component.ts b/client/src/app/+stats/video/video-stats.component.ts index 51738f8dc..4ce14902d 100644 --- a/client/src/app/+stats/video/video-stats.component.ts +++ b/client/src/app/+stats/video/video-stats.component.ts @@ -223,7 +223,7 @@ export class VideoStatsComponent implements OnInit { private buildLiveFilter (session: LiveVideoSession) { return { id: session.startDate + '|' + session.endDate, - label: $localize`Of live of ${new Date(session.startDate).toLocaleString()}` + label: $localize`Live as of ${new Date(session.startDate).toLocaleString()}` } } @@ -276,6 +276,10 @@ export class VideoStatsComponent implements OnInit { moreInfo: overallStats.viewersPeak !== 0 ? $localize`at ${new Date(overallStats.viewersPeakDate).toLocaleString()}` : undefined + }, + { + label: $localize`Unique viewers`, + value: this.numberFormatter.transform(overallStats.totalViewers) } ] diff --git a/server/models/view/local-video-viewer.ts b/server/models/view/local-video-viewer.ts index b8c372040..12350861b 100644 --- a/server/models/view/local-video-viewer.ts +++ b/server/models/view/local-video-viewer.ts @@ -125,6 +125,7 @@ export class LocalVideoViewerModel extends Model