From 1abc4fd5358bc582f54b5113adc630042253d417 Mon Sep 17 00:00:00 2001 From: Zach Tibbitts Date: Thu, 1 Mar 2007 22:32:02 +0000 Subject: [PATCH] fix time calculation --- src/dcommon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dcommon.py b/src/dcommon.py index eb9ac0840..1abc874d2 100644 --- a/src/dcommon.py +++ b/src/dcommon.py @@ -36,12 +36,12 @@ PLUGIN_DIR = INSTALL_PREFIX + '/share/deluge/plugins' def estimate_eta(state): try: - return ftime(get_eta(state["total_size"], state["total_download"], state["download_rate"])) + return ftime(get_eta(state["total_size"], state["total_done"], state["download_rate"])) except ZeroDivisionError: return _("Infinity") def get_eta(size, done, rate): - return int( (size - done) / rate ) + return long( (size - done) / rate ) # Returns formatted string describing filesize # fsize_b should be in bytes