mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 04:24:27 +00:00
Fix #646 when calculating share ratio use the 'total_done' value if 'all_time_download' is 0
This commit is contained in:
parent
56fb8f6225
commit
44223592b0
@ -418,11 +418,12 @@ class Torrent:
|
|||||||
else:
|
else:
|
||||||
status = self.status
|
status = self.status
|
||||||
|
|
||||||
# Return -1.0 if the downloaded bytes is 0, this is to represent infinity
|
downloaded = status.all_time_download
|
||||||
if status.all_time_download == 0:
|
# We use 'total_done' if the downloaded value is 0
|
||||||
return -1.0
|
if downloaded == 0:
|
||||||
|
downloaded = status.total_done
|
||||||
|
|
||||||
return float(status.all_time_upload) / float(status.all_time_download)
|
return float(status.all_time_upload) / float(downloaded)
|
||||||
|
|
||||||
def get_files(self):
|
def get_files(self):
|
||||||
"""Returns a list of files this torrent contains"""
|
"""Returns a list of files this torrent contains"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user