Fix bug in calculating the ETA for seeding torrents with a stop seed
ratio set
This commit is contained in:
parent
0459202653
commit
c028b861f8
|
@ -8,6 +8,7 @@ Deluge 1.1.0 - "" (In Development)
|
|||
* Implement #368 add torrents by infohash/magnet uri (trackerless torrents)
|
||||
* Remove remaining gtk functions in common
|
||||
* Tracker icons.
|
||||
* Add ETA for torrents with stop at seed ratio set
|
||||
|
||||
GtkUI:
|
||||
* Add peer progress to the peers tab
|
||||
|
|
|
@ -484,11 +484,7 @@ class Core(
|
|||
|
||||
def export_get_torrent_status(self, torrent_id, keys):
|
||||
# Build the status dictionary
|
||||
try:
|
||||
status = self.torrents[torrent_id].get_status(keys)
|
||||
except KeyError:
|
||||
# The torrent_id is not found in the torrentmanager, so return None
|
||||
return None
|
||||
status = self.torrents[torrent_id].get_status(keys)
|
||||
|
||||
# Get the leftover fields and ask the plugin manager to fill them
|
||||
leftover_fields = list(set(keys) - set(status.keys()))
|
||||
|
@ -496,7 +492,7 @@ class Core(
|
|||
status.update(self.plugins.get_status(torrent_id, leftover_fields))
|
||||
return status
|
||||
|
||||
def export_get_torrents_status(self, filter_dict, keys ):
|
||||
def export_get_torrents_status(self, filter_dict, keys):
|
||||
"""
|
||||
returns all torrents , optionally filtered by filter_dict.
|
||||
"""
|
||||
|
@ -506,7 +502,7 @@ class Core(
|
|||
# Get the torrent status for each torrent_id
|
||||
for torrent_id in torrent_ids:
|
||||
status_dict[torrent_id] = self.export_get_torrent_status(torrent_id, keys)
|
||||
# Emit the torrent_status signal to the clients
|
||||
|
||||
return status_dict
|
||||
|
||||
def export_get_filter_tree(self , show_zero_hits=True, hide_cat=None):
|
||||
|
|
|
@ -401,7 +401,7 @@ class Torrent:
|
|||
# We're a seed, so calculate the time to the 'stop_share_ratio'
|
||||
if not status.upload_payload_rate:
|
||||
return 0
|
||||
stop_ratio = self.config["stop_seed_ratio"] if self.config["stop_at_seed_ratio"] else self.options["stop_seed_ratio"]
|
||||
stop_ratio = self.config["stop_seed_ratio"] if self.config["stop_seed_at_ratio"] else self.options["stop_seed_ratio"]
|
||||
|
||||
return ((status.all_time_download * stop_ratio) - status.all_time_upload) / status.upload_payload_rate
|
||||
|
||||
|
|
Loading…
Reference in New Issue