mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
reformat peers info
This commit is contained in:
@@ -45,7 +45,7 @@ func Start(port, sslport, sslCert, sslKey string, sslEnabled, roSets, searchWA b
|
||||
l.Close()
|
||||
}
|
||||
if err != nil {
|
||||
log.TLogln("Port", sslport, "already in use! Please set different port for HTTPS. Abort")
|
||||
log.TLogln("Port", sslport, "already in use! Please set different ssl port for HTTPS. Abort")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ func Start(port, sslport, sslCert, sslKey string, sslEnabled, roSets, searchWA b
|
||||
l.Close()
|
||||
}
|
||||
if err != nil {
|
||||
log.TLogln("Port", port, "already in use! Please set different sslport for HTTP. Abort")
|
||||
log.TLogln("Port", port, "already in use! Please set different port for HTTP. Abort")
|
||||
os.Exit(1)
|
||||
}
|
||||
// remove old disk caches
|
||||
|
||||
@@ -62,7 +62,7 @@ func (t *Torrent) Preload(index int, size int64) {
|
||||
// Запуск лога в отдельном потоке
|
||||
go func() {
|
||||
for t.Stat == state.TorrentPreload {
|
||||
stat := fmt.Sprint(file.Torrent().InfoHash().HexString(), " ", utils2.Format(float64(t.PreloadedBytes)), "/", utils2.Format(float64(t.PreloadSize)), " Speed:", utils2.Format(t.DownloadSpeed), " Peers:[", t.Torrent.Stats().ConnectedSeeders, "]", t.Torrent.Stats().ActivePeers, "/", t.Torrent.Stats().TotalPeers)
|
||||
stat := fmt.Sprint(file.Torrent().InfoHash().HexString(), " ", utils2.Format(float64(t.PreloadedBytes)), "/", utils2.Format(float64(t.PreloadSize)), " Speed:", utils2.Format(t.DownloadSpeed), " Peers:", t.Torrent.Stats().ActivePeers, "/", t.Torrent.Stats().TotalPeers, " [Seeds:", t.Torrent.Stats().ConnectedSeeders, "]")
|
||||
log.TLogln("Preload:", stat)
|
||||
t.AddExpiredTime(time.Second * time.Duration(settings.BTsets.TorrentDisconnectTimeout))
|
||||
time.Sleep(time.Second)
|
||||
@@ -158,7 +158,7 @@ func (t *Torrent) Preload(index int, size int64) {
|
||||
|
||||
wg.Wait()
|
||||
}
|
||||
log.TLogln("End preload:", file.Torrent().InfoHash().HexString(), "Peers:[", t.Torrent.Stats().ConnectedSeeders, "]", t.Torrent.Stats().ActivePeers, "/", t.Torrent.Stats().TotalPeers)
|
||||
log.TLogln("End preload:", file.Torrent().InfoHash().HexString(), "Peers:", t.Torrent.Stats().ActivePeers, "/", t.Torrent.Stats().TotalPeers, "[ Seeds:", t.Torrent.Stats().ConnectedSeeders, "]")
|
||||
}
|
||||
|
||||
func (t *Torrent) findFileIndex(index int) *torrent.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}
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
"Offline": "Извън линия",
|
||||
"OK": "OK",
|
||||
"OpenLink": "Отвори линк",
|
||||
"Peers": "Пиъри",
|
||||
"Peers": "Пиъри·Сийдъри",
|
||||
"PiecesCount": "Брой парчета",
|
||||
"PiecesLength": "Дължина на парчетата",
|
||||
"Playlist": "Плейлист",
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
"Offline": "Offline",
|
||||
"OK": "OK",
|
||||
"OpenLink": "Open link",
|
||||
"Peers": "Peers",
|
||||
"Peers": "Peers·Seeds",
|
||||
"PiecesCount": "Pieces count",
|
||||
"PiecesLength": "Pieces length",
|
||||
"Playlist": "Playlist",
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
"Offline": "Сервер недоступен",
|
||||
"OK": "OK",
|
||||
"OpenLink": "Открыть",
|
||||
"Peers": "Пиры",
|
||||
"Peers": "Пиры·Сиды",
|
||||
"PiecesCount": "Кол-во блоков",
|
||||
"PiecesLength": "Размер блока",
|
||||
"Playlist": "Плейлист",
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
"Offline": "Сервер не доступний",
|
||||
"OK": "OK",
|
||||
"OpenLink": "Відкрити",
|
||||
"Peers": "Піри",
|
||||
"Peers": "Піри·Сіди",
|
||||
"PiecesCount": "К-сть блоків",
|
||||
"PiecesLength": "Розмір блоку",
|
||||
"Playlist": "Плейлист",
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
"Offline": "离线",
|
||||
"OK": "确定",
|
||||
"OpenLink": "打开链接",
|
||||
"Peers": "Peers",
|
||||
"Peers": "Peers·Seeds",
|
||||
"PiecesCount": "块数量",
|
||||
"PiecesLength": "块长度",
|
||||
"Playlist": "播放列表",
|
||||
|
||||
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user