fix: changed transmission ratio calculation to total size instead of downloaded size (#791)

This commit is contained in:
RA341
2024-08-20 21:54:54 -04:00
committed by GitHub
parent cc2c24f206
commit 69feefe2f9

View File

@@ -383,7 +383,10 @@ class TransmissionClientGatewayService extends ClientGatewayService {
...(await Promise.all( ...(await Promise.all(
torrents.map(async (torrent) => { torrents.map(async (torrent) => {
const percentComplete = (torrent.haveValid / torrent.totalSize) * 100; 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 trackerURIs = getDomainsFromURLs(torrent.trackers.map((tracker) => tracker.announce));
const status = torrentPropertiesUtil.getTorrentStatus(torrent); const status = torrentPropertiesUtil.getTorrentStatus(torrent);