From 221304325a005e7cb91c73dc38b734fdc8fefec1 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Tue, 19 Jun 2007 23:37:23 +0000 Subject: [PATCH] Fixes for auto end seed ratio. Torrents will now pause and queue to bottom when ratio is hit. --- src/core.py | 6 ++++-- src/dialogs.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core.py b/src/core.py index aba44169f..57c256df1 100644 --- a/src/core.py +++ b/src/core.py @@ -454,6 +454,7 @@ class Manager: 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! + self.set_user_pause(unique_ID, True, enforce_queue=False) # Pause and resume torrents for index in range(len(self.state.queue)): @@ -569,9 +570,10 @@ class Manager: # Miscellaneous minor functions - def set_user_pause(self, unique_ID, new_value): + def set_user_pause(self, unique_ID, new_value, enforce_queue=True): self.unique_IDs[unique_ID].user_paused = new_value - self.apply_queue() + if enforce_queue: + self.apply_queue() def set_ratio(self, unique_ID, num): deluge_core.set_ratio(unique_ID, num) diff --git a/src/dialogs.py b/src/dialogs.py index ccfa8d205..c3d96464e 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -82,7 +82,7 @@ class PreferencesDlg: self.glade.get_widget("spin_torrents").set_value(self.preferences.get("max_number_torrents", int, default=-1)) self.glade.get_widget("chk_seedbottom").set_active(self.preferences.get("queue_seeds_to_bottom", bool, default=False)) self.glade.get_widget("chk_autoseed").set_active(self.preferences.get("auto_end_seeding", bool, default=False)) - self.glade.get_widget("ratio_spinner").set_value(self.preferences.get("auto_seed_ratio", int, default=-1)) + self.glade.get_widget("ratio_spinner").set_value(self.preferences.get("auto_seed_ratio")) self.glade.get_widget("chk_dht").set_active(self.preferences.get("enable_dht", bool, default=True)) self.glade.get_widget("spin_gui").set_value(self.preferences.get("gui_update_interval", float, default=1.0))