From 69feefe2f97be8727de6bd2e35c6715f341aa15b Mon Sep 17 00:00:00 2001 From: RA341 <39427910+RA341@users.noreply.github.com> Date: Tue, 20 Aug 2024 21:54:54 -0400 Subject: [PATCH] fix: changed transmission ratio calculation to total size instead of downloaded size (#791) --- server/services/Transmission/clientGatewayService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/services/Transmission/clientGatewayService.ts b/server/services/Transmission/clientGatewayService.ts index 34f78f54..9d70d72d 100644 --- a/server/services/Transmission/clientGatewayService.ts +++ b/server/services/Transmission/clientGatewayService.ts @@ -383,7 +383,10 @@ class TransmissionClientGatewayService extends ClientGatewayService { ...(await Promise.all( torrents.map(async (torrent) => { const percentComplete = (torrent.haveValid / torrent.totalSize) * 100; - const ratio = torrent.downloadedEver === 0 ? -1 : torrent.uploadedEver / torrent.downloadedEver; + const ratio = + torrent.downloadedEver === 0 + ? torrent.uploadedEver / torrent.totalSize + : torrent.uploadedEver / torrent.downloadedEver; const trackerURIs = getDomainsFromURLs(torrent.trackers.map((tracker) => tracker.announce)); const status = torrentPropertiesUtil.getTorrentStatus(torrent);