mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
Fix #358 properly emit torrent_removed signal to clients when torrent is
removed by queue system
This commit is contained in:
parent
692ff7a979
commit
fefc78f468
2 changed files with 7 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue