From 4ec25ae825f8dee44d948b38d8216f9a239ff7b3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Nov 2020 15:57:38 +0100 Subject: Refactor last PR --- client/src/app/shared/shared-main/video/video.model.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'client/src/app/shared/shared-main') 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 04e7bd717..adb6e884f 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts @@ -203,4 +203,14 @@ export class Video implements VideoServerModel { canBeDuplicatedBy (user: AuthUser) { return user && this.isLocal === false && user.hasRight(UserRight.MANAGE_VIDEOS_REDUNDANCIES) } + + getExactNumberOfViews () { + if (this.views < 1000) return '' + + if (this.isLive) { + return $localize`${this.views} viewers` + } + + return $localize`${this.views} views` + } } -- cgit v1.2.3