From 488bbb0a53f19145016dec1f82a7432104d5d7cc Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 31 Mar 2008 00:15:36 +0000 Subject: [PATCH] Attempt to fix improper ratio. --- src/core.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core.py b/src/core.py index 93b715dd5..725330f99 100644 --- a/src/core.py +++ b/src/core.py @@ -1184,9 +1184,10 @@ likely the tracker did not responsd in utf-8." def calc_ratio(self, unique_ID, torrent_state): try: - up = float((self.unique_IDs[unique_ID].initial_uploaded_memory + self.get_core_torrent_state(unique_ID, False)['total_upload']) / 1024) - except AttributeError: up = float((self.unique_IDs[unique_ID].uploaded_memory + self.get_core_torrent_state(unique_ID, False)['total_upload']) / 1024) + except AttributeError: + up = 0 + down = float(torrent_state["total_done"] / 1024) try: ret = up/down