Fix #545 use proper values in ratio calculation

This commit is contained in:
Andrew Resch 2008-10-23 16:52:09 +00:00
parent bdbed9f893
commit cb19d71b7d
2 changed files with 28 additions and 27 deletions

View File

@ -410,8 +410,8 @@ class Torrent:
else: else:
status = self.status status = self.status
up = self.total_uploaded + status.total_payload_upload up = status.all_time_upload
down = status.total_done down = status.all_time_download
# Convert 'up' and 'down' to floats for proper calculation # Convert 'up' and 'down' to floats for proper calculation
up = float(up) up = float(up)
@ -538,11 +538,12 @@ class Torrent:
"distributed_copies": distributed_copies, "distributed_copies": distributed_copies,
"total_done": self.status.total_done, "total_done": self.status.total_done,
"total_uploaded": self.status.all_time_upload, "total_uploaded": self.status.all_time_upload,
"all_time_download": self.status.all_time_download,
"state": self.state, "state": self.state,
"paused": self.status.paused, "paused": self.status.paused,
"progress": progress, "progress": progress,
"next_announce": self.status.next_announce.seconds, "next_announce": self.status.next_announce.seconds,
"total_payload_download": self.status.all_time_download, "total_payload_download": self.status.total_payload_download,
"total_payload_upload": self.status.total_payload_upload, "total_payload_upload": self.status.total_payload_upload,
"download_payload_rate": self.status.download_payload_rate, "download_payload_rate": self.status.download_payload_rate,
"upload_payload_rate": self.status.upload_payload_rate, "upload_payload_rate": self.status.upload_payload_rate,

View File

@ -71,7 +71,7 @@ class StatisticsTab(Tab):
self.label_widgets = [ self.label_widgets = [
(glade.get_widget("summary_pieces"), fpeer_size_second, ("num_pieces", "piece_length")), (glade.get_widget("summary_pieces"), fpeer_size_second, ("num_pieces", "piece_length")),
(glade.get_widget("summary_availability"), fratio, ("distributed_copies",)), (glade.get_widget("summary_availability"), fratio, ("distributed_copies",)),
(glade.get_widget("summary_total_downloaded"), fpeer_sized, ("total_done", "total_payload_download")), (glade.get_widget("summary_total_downloaded"), fpeer_sized, ("all_time_download", "total_payload_download")),
(glade.get_widget("summary_total_uploaded"), fpeer_sized, ("total_uploaded", "total_payload_upload")), (glade.get_widget("summary_total_uploaded"), fpeer_sized, ("total_uploaded", "total_payload_upload")),
(glade.get_widget("summary_download_speed"), fspeed, ("download_payload_rate", "max_download_speed")), (glade.get_widget("summary_download_speed"), fspeed, ("download_payload_rate", "max_download_speed")),
(glade.get_widget("summary_upload_speed"), fspeed, ("upload_payload_rate", "max_upload_speed")), (glade.get_widget("summary_upload_speed"), fspeed, ("upload_payload_rate", "max_upload_speed")),
@ -101,7 +101,7 @@ class StatisticsTab(Tab):
# Get the torrent status # Get the torrent status
status_keys = ["progress", "num_pieces", "piece_length", status_keys = ["progress", "num_pieces", "piece_length",
"distributed_copies", "total_done", "total_payload_download", "distributed_copies", "all_time_download", "total_payload_download",
"total_uploaded", "total_payload_upload", "download_payload_rate", "total_uploaded", "total_payload_upload", "download_payload_rate",
"upload_payload_rate", "num_peers", "num_seeds", "total_peers", "upload_payload_rate", "num_peers", "num_seeds", "total_peers",
"total_seeds", "eta", "ratio", "next_announce", "total_seeds", "eta", "ratio", "next_announce",