diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 1bafaa84a..7e7e9a926 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -197,8 +197,9 @@ class Torrent: def set_auto_managed(self, auto_managed): self.options["auto_managed"] = auto_managed - self.handle.auto_managed(auto_managed) - self.update_state() + if not (self.handle.is_paused() and not self.handle.is_auto_managed()): + self.handle.auto_managed(auto_managed) + self.update_state() def set_stop_ratio(self, stop_ratio): self.options["stop_ratio"] = stop_ratio diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index fc57ec005..fe8f20154 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -327,6 +327,8 @@ class TorrentManager(component.Component): return log.debug("handle id: %s", str(handle.info_hash())) + # Set auto_managed to False because the torrent is paused + handle.auto_managed(False) # Create a Torrent object torrent = Torrent(handle, options, state, filename) # Add the torrent object to the dictionary @@ -338,8 +340,7 @@ class TorrentManager(component.Component): # Resume the torrent if needed if not options["add_paused"]: - handle.resume() - handle.auto_managed(options["auto_managed"]) + torrent.resume() # Write the .torrent file to the state directory if filedump: