From 61cfb7994ab8d870bbb92cc0d76e8f4b07d2171a Mon Sep 17 00:00:00 2001 From: RA341 Date: Tue, 20 Aug 2024 13:38:24 -0400 Subject: [PATCH 1/2] fix: changed transmission ratio calculation to total size instead of downloaded size (#720) --- server/services/Transmission/clientGatewayService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/services/Transmission/clientGatewayService.ts b/server/services/Transmission/clientGatewayService.ts index 34f78f546..26a654046 100644 --- a/server/services/Transmission/clientGatewayService.ts +++ b/server/services/Transmission/clientGatewayService.ts @@ -383,7 +383,7 @@ 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.totalSize === 0 ? -1 : torrent.uploadedEver / torrent.totalSize; const trackerURIs = getDomainsFromURLs(torrent.trackers.map((tracker) => tracker.announce)); const status = torrentPropertiesUtil.getTorrentStatus(torrent); From 0ee15844084686fc9e0787f4c1b729f65f17556b Mon Sep 17 00:00:00 2001 From: RA341 Date: Tue, 20 Aug 2024 21:45:51 -0400 Subject: [PATCH 2/2] fix: changed calculation according to discussion --- 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 26a654046..9d70d72dc 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.totalSize === 0 ? -1 : torrent.uploadedEver / torrent.totalSize; + 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);