fix seeding ratio stop on finished torrents

This commit is contained in:
Marcos Pinto 2007-12-11 01:08:49 +00:00
parent c35a13b227
commit 9eaf2e602a

View file

@ -579,7 +579,7 @@ Space:") + " " + nice_free)
for unique_ID in self.unique_IDs:
torrent_state = self.get_core_torrent_state(unique_ID)
if torrent_state['is_seed'] and not torrent_state['is_paused']:
if (torrent_state["total_wanted"] - torrent_state["total_wanted_done"] == 0) and not torrent_state['is_paused']:
ratio = self.calc_ratio(unique_ID, torrent_state)
if ratio >= self.get_pref('auto_seed_ratio'):
self.queue_bottom(unique_ID, enforce_queue=False) # don't recurse!
@ -588,7 +588,7 @@ Space:") + " " + nice_free)
if self.get_pref('clear_max_ratio_torrents'):
for unique_ID in self.unique_IDs.keys():
torrent_state = self.get_core_torrent_state(unique_ID)
if torrent_state['is_seed']:
if (torrent_state["total_wanted"] - torrent_state["total_wanted_done"] == 0):
ratio = self.calc_ratio(unique_ID, torrent_state)
if ratio >= self.get_pref('auto_seed_ratio'):
self.removed_unique_ids[unique_ID] = 1