diff --git a/deluge/core/core.py b/deluge/core/core.py index 38b96559d..15575f5b2 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -424,8 +424,6 @@ class Core( if self.torrents.remove(torrent_id, remove_torrent, remove_data): # Run the plugin hooks for 'post_torrent_remove' self.plugins.run_post_torrent_remove(torrent_id) - # Emit the torrent_removed signal - self.torrent_removed(torrent_id) def export_force_reannounce(self, torrent_ids): log.debug("Forcing reannouncment to: %s", torrent_ids) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 004043df7..e1392524d 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -186,10 +186,11 @@ class TorrentManager(component.Component): if torrent.stop_at_ratio: stop_ratio = torrent.stop_ratio if torrent.get_ratio() >= stop_ratio and torrent.is_finished: - if not torrent.handle.is_paused(): - torrent.pause() if self.config["remove_seed_at_ratio"] or torrent.remove_at_ratio: self.remove(torrent_id) + break + if not torrent.handle.is_paused(): + torrent.pause() def __getitem__(self, torrent_id): """Return the Torrent with torrent_id""" @@ -434,6 +435,10 @@ class TorrentManager(component.Component): # Save the session state self.save_state() + + # Emit the signal to the clients + self.signals.emit("torrent_removed", torrent_id) + return True def pause_all(self):