aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-20 11:18:47 +0200
committerChocobozzz <me@florianbigard.com>2023-07-20 11:18:47 +0200
commit8a9d247105ffd8761652f20cd431e890268fd11a (patch)
tree7aacbe69d69741ebb680bd20e3eb8e54060a4eda /client
parent4ddf488ab5c3f58ae6be811737db7598d05ed13c (diff)
downloadPeerTube-8a9d247105ffd8761652f20cd431e890268fd11a.tar.gz
PeerTube-8a9d247105ffd8761652f20cd431e890268fd11a.tar.zst
PeerTube-8a9d247105ffd8761652f20cd431e890268fd11a.zip
Fix "undefined" in stats card
Diffstat (limited to 'client')
-rw-r--r--client/src/assets/player/shared/stats/stats-card.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/client/src/assets/player/shared/stats/stats-card.ts b/client/src/assets/player/shared/stats/stats-card.ts
index fad68cec9..077c900e5 100644
--- a/client/src/assets/player/shared/stats/stats-card.ts
+++ b/client/src/assets/player/shared/stats/stats-card.ts
@@ -273,6 +273,8 @@ class StatsCard extends Component {
273 colorSpace?: string 273 colorSpace?: string
274 }) { 274 }) {
275 const { playerNetworkInfo, progress, colorSpace, codecs, resolution, buffer, latency } = options 275 const { playerNetworkInfo, progress, colorSpace, codecs, resolution, buffer, latency } = options
276 const { downloadedFromServer, downloadedFromPeers } = playerNetworkInfo
277
276 const player = this.player() 278 const player = this.player()
277 279
278 const videoQuality: VideoPlaybackQuality = player.getVideoPlaybackQuality() 280 const videoQuality: VideoPlaybackQuality = player.getVideoPlaybackQuality()
@@ -291,10 +293,14 @@ class StatsCard extends Component {
291 ? `${playerNetworkInfo.downloadSpeed} &dArr; / ${playerNetworkInfo.uploadSpeed} &uArr;` 293 ? `${playerNetworkInfo.downloadSpeed} &dArr; / ${playerNetworkInfo.uploadSpeed} &uArr;`
292 : undefined 294 : undefined
293 295
294 const totalTransferred = playerNetworkInfo.totalDownloaded 296 let totalTransferred = playerNetworkInfo.totalDownloaded
295 ? `${playerNetworkInfo.totalDownloaded} &dArr; / ${playerNetworkInfo.totalUploaded} &uArr;` 297 ? `${playerNetworkInfo.totalDownloaded} &dArr;`
296 : undefined 298 : ''
297 const { downloadedFromServer, downloadedFromPeers } = playerNetworkInfo 299
300 if (playerNetworkInfo.totalUploaded) {
301 totalTransferred += `/ ${playerNetworkInfo.totalUploaded} &uArr;`
302 }
303
298 const downloadBreakdown = playerNetworkInfo.downloadedFromServer 304 const downloadBreakdown = playerNetworkInfo.downloadedFromServer
299 ? player.localize('{1} from servers · {2} from peers', [ downloadedFromServer, downloadedFromPeers ]) 305 ? player.localize('{1} from servers · {2} from peers', [ downloadedFromServer, downloadedFromPeers ])
300 : undefined 306 : undefined