mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +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):
|
||||
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…
Add table
Reference in a new issue