mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 05:47:50 +00:00
Fix paused torrents not being paused upon restart
This commit is contained in:
parent
c2a24bce8a
commit
0792ad21cd
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user