mirror of
https://github.com/nimbold/Firelink.git
synced 2026-09-03 14:37:56 +00:00
fix(torrent): use live peer telemetry in properties
- source the Properties peer card from live Aria2 status counts - distinguish connected peers from unavailable peer details - remove redundant peer-summary IPC and harden count parsing - add responsive, accessible peer/seeder presentation and regressions
This commit is contained in:
@@ -10,6 +10,14 @@ export const formatPropertiesDiagnosticCount = (value: number, locale: string):
|
||||
return new Intl.NumberFormat(resolveAppLocale(locale)).format(value);
|
||||
};
|
||||
|
||||
export const hasLiveTorrentPeerWithoutDetails = (
|
||||
connectedPeers: number | undefined,
|
||||
detailedPeers: number,
|
||||
): boolean => Number.isSafeInteger(connectedPeers)
|
||||
&& (connectedPeers ?? 0) > 0
|
||||
&& Number.isSafeInteger(detailedPeers)
|
||||
&& detailedPeers === 0;
|
||||
|
||||
export const formatPropertiesAvailability = (availability: number, locale: string): string => {
|
||||
if (!Number.isFinite(availability) || availability < 0) return '—';
|
||||
return new Intl.NumberFormat(resolveAppLocale(locale), { maximumFractionDigits: 2 }).format(availability);
|
||||
|
||||
Reference in New Issue
Block a user