mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
fix time calculation
This commit is contained in:
parent
9fb9727782
commit
1abc4fd535
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue