Skip to content

Commit a69ccb2

Browse files
committed
Fix tracker dl total calculation
1 parent 28eca60 commit a69ccb2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/rpc/torrent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function getTrackerStatus(torrent: TorrentBase): string {
8686
function getTrackerDlCount(torrent: TorrentBase): number {
8787
const trackers = torrent.trackerStats as TrackerStats[];
8888
if (torrent.status === Status.stopped || trackers.length === 0) return -1;
89-
return trackers.map((t) => t.downloadCount as number).reduce((total, current) => total + current, 0) as number;
89+
return trackers.map((t) => t.downloadCount as number).reduce((total, current) => total + Math.max(current, 0), 0);
9090
}
9191

9292
const portRe = /:\d+$/;

0 commit comments

Comments
 (0)