reformat peers info

This commit is contained in:
nikk gitanes
2024-02-22 10:38:14 +03:00
parent 4d2fd19f65
commit 26e7956ef9
9 changed files with 13 additions and 12 deletions

View File

@@ -51,7 +51,7 @@ export const PeersWidget = ({ data }) => {
return (
<StatisticsField
title={t('Peers')}
value={getPeerString(data) || '0 · 0 / 0'}
value={getPeerString(data) || '0 / 0 · 0'}
iconBg={iconBGColor}
valueBg={valueBGColor}
icon={SwapVerticalCircleIcon}

View File

@@ -72,7 +72,7 @@
"Offline": "Извън линия",
"OK": "OK",
"OpenLink": "Отвори линк",
"Peers": "Пиъри",
"Peers": "Пиъри·Сийдъри",
"PiecesCount": "Брой парчета",
"PiecesLength": "Дължина на парчетата",
"Playlist": "Плейлист",

View File

@@ -72,7 +72,7 @@
"Offline": "Offline",
"OK": "OK",
"OpenLink": "Open link",
"Peers": "Peers",
"Peers": "Peers·Seeds",
"PiecesCount": "Pieces count",
"PiecesLength": "Pieces length",
"Playlist": "Playlist",

View File

@@ -72,7 +72,7 @@
"Offline": "Сервер недоступен",
"OK": "OK",
"OpenLink": "Открыть",
"Peers": "Пиры",
"Peers": "Пиры·Сиды",
"PiecesCount": "Кол-во блоков",
"PiecesLength": "Размер блока",
"Playlist": "Плейлист",

View File

@@ -72,7 +72,7 @@
"Offline": "Сервер не доступний",
"OK": "OK",
"OpenLink": "Відкрити",
"Peers": "Піри",
"Peers": "Піри·Сіди",
"PiecesCount": "К-сть блоків",
"PiecesLength": "Розмір блоку",
"Playlist": "Плейлист",

View File

@@ -72,7 +72,7 @@
"Offline": "离线",
"OK": "确定",
"OpenLink": "打开链接",
"Peers": "Peers",
"Peers": "Peers·Seeds",
"PiecesCount": "块数量",
"PiecesLength": "块长度",
"Playlist": "播放列表",

View File

@@ -20,8 +20,9 @@ export function humanizeSpeed(speed) {
}
export function getPeerString(torrent) {
if (!torrent || !torrent.connected_seeders) return null
return `${torrent.connected_seeders} · ${torrent.active_peers} / ${torrent.total_peers}`
if (!torrent || !torrent.active_peers) return null
const seeders = typeof torrent.connected_seeders !== 'undefined' ? torrent.connected_seeders : 0
return `${torrent.active_peers} / ${torrent.total_peers} · ${seeders}`
}
export const shortenText = (text, sympolAmount) =>