mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 12:04:10 +00:00
fix time calculation
This commit is contained in:
parent
9fb9727782
commit
1abc4fd535
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user