mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 20:14:13 +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):
|
def estimate_eta(state):
|
||||||
try:
|
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:
|
except ZeroDivisionError:
|
||||||
return _("Infinity")
|
return _("Infinity")
|
||||||
|
|
||||||
def get_eta(size, done, rate):
|
def get_eta(size, done, rate):
|
||||||
return int( (size - done) / rate )
|
return long( (size - done) / rate )
|
||||||
|
|
||||||
# Returns formatted string describing filesize
|
# Returns formatted string describing filesize
|
||||||
# fsize_b should be in bytes
|
# fsize_b should be in bytes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user