diff --git a/client/src/app/+my-account/my-account-import-export/my-account-import.component.html b/client/src/app/+my-account/my-account-import-export/my-account-import.component.html index 24dda897c..9cca9df51 100644 --- a/client/src/app/+my-account/my-account-import-export/my-account-import.component.html +++ b/client/src/app/+my-account/my-account-import-export/my-account-import.component.html @@ -54,7 +54,7 @@ } @else { diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html index 443b575c1..3d90c8187 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html @@ -50,7 +50,7 @@ diff --git a/client/src/app/+videos/+video-edit/video-update.component.html b/client/src/app/+videos/+video-edit/video-update.component.html index 9c7cd3fe0..80103b727 100644 --- a/client/src/app/+videos/+video-edit/video-update.component.html +++ b/client/src/app/+videos/+video-edit/video-update.component.html @@ -3,7 +3,7 @@ diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts index 8286da82b..f8ec60493 100644 --- a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts +++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts @@ -61,7 +61,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, @Input() textValue?: string @Output() commentCreated = new EventEmitter() - @Output() cancel = new EventEmitter() + @Output() cancelEdition = new EventEmitter() @ViewChild('visitorModal', { static: true }) visitorModal: NgbModal @ViewChild('emojiModal', { static: true }) emojiModal: NgbModal @@ -186,7 +186,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, } cancelCommentReply () { - this.cancel.emit(null) + this.cancelEdition.emit(null) this.form.value['text'] = this.textareaElement.nativeElement.value = '' } diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.html b/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.html index ec0d5184e..2722909ca 100644 --- a/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.html +++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.html @@ -69,7 +69,7 @@ [parentComments]="newParentComments" [focusOnInit]="true" (commentCreated)="onCommentReplyCreated($event)" - (cancel)="onResetReply()" + (cancelEdition)="onResetReply()" [textValue]="redraftValue" > diff --git a/client/src/app/+videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.html index 4fd54c14e..65b0f59b2 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.html +++ b/client/src/app/+videos/+video-watch/video-watch.component.html @@ -43,7 +43,7 @@ Published • - +
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 @@ - +
diff --git a/client/src/app/shared/standalone-upload/upload-progress.component.ts b/client/src/app/shared/standalone-upload/upload-progress.component.ts index b2736a8da..b37a9a588 100644 --- a/client/src/app/shared/standalone-upload/upload-progress.component.ts +++ b/client/src/app/shared/standalone-upload/upload-progress.component.ts @@ -17,7 +17,7 @@ export class UploadProgressComponent { @Input() uploaded: boolean @Input() enableRetryAfterError: boolean - @Output() cancel = new EventEmitter() + @Output() cancelUpload = new EventEmitter() @Output() retry = new EventEmitter() getUploadingLabel () { diff --git a/client/src/assets/player/peertube-player.ts b/client/src/assets/player/peertube-player.ts index 7bccbc42a..1060686b2 100644 --- a/client/src/assets/player/peertube-player.ts +++ b/client/src/assets/player/peertube-player.ts @@ -41,7 +41,7 @@ import { buildVideoLink, decorateVideoLink, isDefaultLocale, pick } from '@peert import { saveAverageBandwidth } from './peertube-player-local-storage' import { ControlBarOptionsBuilder, HLSOptionsBuilder, WebVideoOptionsBuilder } from './shared/player-options-builder' import { TranslationsManager } from './translations-manager' -import { PeerTubePlayerContructorOptions, PeerTubePlayerLoadOptions, PlayerNetworkInfo, VideoJSPluginOptions } from './types' +import { PeerTubePlayerConstructorOptions, PeerTubePlayerLoadOptions, PlayerNetworkInfo, VideoJSPluginOptions } from './types' // Change 'Playback Rate' to 'Speed' (smaller for our settings menu) (videojs.getComponent('PlaybackRateMenuButton') as any).prototype.controlText_ = 'Speed' @@ -69,7 +69,7 @@ export class PeerTubePlayer { private currentLoadOptions: PeerTubePlayerLoadOptions - constructor (private options: PeerTubePlayerContructorOptions) { + constructor (private options: PeerTubePlayerConstructorOptions) { this.pluginsManager = options.pluginsManager } diff --git a/client/src/assets/player/shared/player-options-builder/control-bar-options-builder.ts b/client/src/assets/player/shared/player-options-builder/control-bar-options-builder.ts index 983ac4259..42f472df4 100644 --- a/client/src/assets/player/shared/player-options-builder/control-bar-options-builder.ts +++ b/client/src/assets/player/shared/player-options-builder/control-bar-options-builder.ts @@ -1,13 +1,13 @@ import { NextPreviousVideoButtonOptions, PeerTubeLinkButtonOptions, - PeerTubePlayerContructorOptions, + PeerTubePlayerConstructorOptions, PeerTubePlayerLoadOptions, TheaterButtonOptions } from '../../types' type ControlBarOptionsBuilderConstructorOptions = - Pick & + Pick & { videoShortUUID: () => string p2pEnabled: () => boolean diff --git a/client/src/assets/player/shared/player-options-builder/hls-options-builder.ts b/client/src/assets/player/shared/player-options-builder/hls-options-builder.ts index e0c8a2d73..db33c06c3 100644 --- a/client/src/assets/player/shared/player-options-builder/hls-options-builder.ts +++ b/client/src/assets/player/shared/player-options-builder/hls-options-builder.ts @@ -10,7 +10,7 @@ import { HLSLoaderClass, HLSPluginOptions, P2PMediaLoaderPluginOptions, - PeerTubePlayerContructorOptions, + PeerTubePlayerConstructorOptions, PeerTubePlayerLoadOptions } from '../../types' import { getRtcConfig, isSameOrigin } from '../common' @@ -22,7 +22,7 @@ import debug from 'debug' const debugLogger = debug('peertube:player:hls') type ConstructorOptions = - Pick & + Pick & Pick diff --git a/client/src/assets/player/types/peertube-player-options.ts b/client/src/assets/player/types/peertube-player-options.ts index 2bb883f40..83d42334b 100644 --- a/client/src/assets/player/types/peertube-player-options.ts +++ b/client/src/assets/player/types/peertube-player-options.ts @@ -5,7 +5,7 @@ import { PlaylistPluginOptions, VideoJSCaption, VideoJSStoryboard } from './peer export type PlayerMode = 'web-video' | 'p2p-media-loader' -export type PeerTubePlayerContructorOptions = { +export type PeerTubePlayerConstructorOptions = { playerElement: () => HTMLVideoElement controls: boolean