diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts
index a91815b95..dae8b046e 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -50,7 +50,7 @@ import { forkJoin, map, Observable, of, Subscription, switchMap } from 'rxjs'
import {
HLSOptions,
PeerTubePlayer,
- PeerTubePlayerContructorOptions,
+ PeerTubePlayerConstructorOptions,
PeerTubePlayerLoadOptions,
PlayerMode,
videojs
@@ -662,7 +662,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
private buildPeerTubePlayerConstructorOptions (options: {
urlOptions: URLOptions
- }): PeerTubePlayerContructorOptions {
+ }): PeerTubePlayerConstructorOptions {
const { urlOptions } = options
return {
diff --git a/client/src/app/shared/shared-main/common/link.component.html b/client/src/app/shared/shared-main/common/link.component.html
index 048429a7e..451bdbf5a 100644
--- a/client/src/app/shared/shared-main/common/link.component.html
+++ b/client/src/app/shared/shared-main/common/link.component.html
@@ -4,10 +4,12 @@
-
-
-
-
-
-
-
+@if (href) {
+
+
+
+} @else {
+
+
+
+}
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 1063499a7..1c092e9ce 100644
--- a/client/src/app/shared/shared-main/video/video.model.ts
+++ b/client/src/app/shared/shared-main/video/video.model.ts
@@ -1,23 +1,23 @@
import { AuthUser } from '@app/core'
import { User } from '@app/core/users/user.model'
-import { durationToString, formatICU, getAbsoluteAPIUrl, getAbsoluteEmbedUrl } from '@app/helpers'
+import { durationToString, getAbsoluteAPIUrl, getAbsoluteEmbedUrl } from '@app/helpers'
import { Actor } from '@app/shared/shared-main/account/actor.model'
import { buildVideoWatchPath, getAllFiles, peertubeTranslate } from '@peertube/peertube-core-utils'
import {
ActorImage,
HTMLServerConfig,
UserRight,
- Video as VideoServerModel,
VideoConstant,
VideoFile,
VideoPrivacy,
VideoPrivacyType,
VideoScheduleUpdate,
+ Video as VideoServerModel,
+ VideoSource,
VideoState,
VideoStateType,
VideoStreamingPlaylist,
- VideoStreamingPlaylistType,
- VideoSource
+ VideoStreamingPlaylistType
} from '@peertube/peertube-models'
export class Video implements VideoServerModel {
@@ -326,12 +326,4 @@ export class Video implements VideoServerModel {
this.isLocal === true &&
(this.account.name === user.username || user.hasRight(UserRight.SEE_ALL_VIDEOS))
}
-
- getExactNumberOfViews () {
- if (this.isLive) {
- return formatICU($localize`{viewers, plural, =0 {No viewers} =1 {1 viewer} other {{viewers} viewers}}`, { viewers: this.viewers })
- }
-
- return formatICU($localize`{views, plural, =0 {No view} =1 {1 view} other {{views} views}}`, { views: this.views })
- }
}
diff --git a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html
index f98fedbbe..fda6a6839 100644
--- a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html
+++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html
@@ -1,10 +1,12 @@
-
-
-
-
-
-
-
+@if (videoHref) {
+
+
+
+} @else {
+
+
+
+}
@@ -29,7 +31,7 @@
@if (video.isLive) {
@if (isLiveStreaming()) {
-
LIVE
+
LIVE
} @else if (isEndedLive()) {
LIVE ENDED
} @else {
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
index 5057b9d67..20b11f8cc 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
@@ -49,10 +49,10 @@
-
+
•
-
+
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html
index d238bd461..25fd6c48f 100644
--- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html
@@ -28,8 +28,8 @@
-
- •
+
+ •
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 b19c8b137..e26ffa04d 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
@@ -1,9 +1,11 @@
-
-
- {video.views, plural, =1 {1 view} other {{{ video.views | myNumberFormatter }} views}}
-
-
-
- {video.viewers, plural, =1 {1 viewer} other {{{ video.viewers | myNumberFormatter }} viewers}}
-
+
+ @if (isLive) {
+
+ {viewers, plural, =1 {1 viewer} other {{{ viewers | myNumberFormatter }} viewers}}
+
+ } @else {
+
+ {views, plural, =1 {1 view} other {{{ views | myNumberFormatter }} views}}
+
+ }
diff --git a/client/src/app/shared/shared-video/video-views-counter.component.ts b/client/src/app/shared/shared-video/video-views-counter.component.ts
index fc290d059..0ff3190d8 100644
--- a/client/src/app/shared/shared-video/video-views-counter.component.ts
+++ b/client/src/app/shared/shared-video/video-views-counter.component.ts
@@ -1,15 +1,25 @@
-import { Component, Input } from '@angular/core'
+import { booleanAttribute, ChangeDetectionStrategy, Component, Input } from '@angular/core'
+import { formatICU } from '@app/helpers'
import { NumberFormatterPipe } from '../shared-main/common/number-formatter.pipe'
-import { NgIf } from '@angular/common'
-import { Video } from '../shared-main/video/video.model'
@Component({
selector: 'my-video-views-counter',
styleUrls: [ './video-views-counter.component.scss' ],
templateUrl: './video-views-counter.component.html',
standalone: true,
- imports: [ NgIf, NumberFormatterPipe ]
+ changeDetection: ChangeDetectionStrategy.OnPush,
+ imports: [ NumberFormatterPipe ]
})
export class VideoViewsCounterComponent {
- @Input() video: Video
+ @Input({ required: true, transform: booleanAttribute }) isLive: boolean
+ @Input({ required: true }) viewers: number
+ @Input({ required: true }) views: number
+
+ getExactNumberOfViews () {
+ if (this.isLive) {
+ return formatICU($localize`{viewers, plural, =0 {No viewers} =1 {1 viewer} other {{viewers} viewers}}`, { viewers: this.viewers })
+ }
+
+ return formatICU($localize`{views, plural, =0 {No view} =1 {1 view} other {{views} views}}`, { views: this.views })
+ }
}
diff --git a/client/src/app/shared/standalone-upload/upload-progress.component.html b/client/src/app/shared/standalone-upload/upload-progress.component.html
index f96324d29..4a54fdfdf 100644
--- a/client/src/app/shared/standalone-upload/upload-progress.component.html
+++ b/client/src/app/shared/standalone-upload/upload-progress.component.html
@@ -8,7 +8,7 @@
@@ -20,7 +20,7 @@
-
+