From b077d5075a0a3b537fd4efc83cb0d28f1a366638 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Tue, 9 Dec 2008 11:14:11 +0000 Subject: [PATCH] Fix ratio calc --- deluge/core/torrent.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index c0dab4ac9..7f94ac3d9 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -418,9 +418,10 @@ class Torrent: else: status = self.status - downloaded = status.all_time_download - # We use 'total_done' if the downloaded value is 0 - if downloaded == 0 and status.total_done > 0: + if status.all_time_download > 0: + downloaded = status.all_time_download + elif status.total_done > 0: + # We use 'total_done' if the downloaded value is 0 downloaded = status.total_done else: # Return -1.0 to signify infinity