mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 15:08:40 +00:00
Fix paused torrents not being paused upon restart
This commit is contained in:
parent
c2a24bce8a
commit
0792ad21cd
2 changed files with 6 additions and 4 deletions
|
@ -197,8 +197,9 @@ class Torrent:
|
||||||
|
|
||||||
def set_auto_managed(self, auto_managed):
|
def set_auto_managed(self, auto_managed):
|
||||||
self.options["auto_managed"] = auto_managed
|
self.options["auto_managed"] = auto_managed
|
||||||
self.handle.auto_managed(auto_managed)
|
if not (self.handle.is_paused() and not self.handle.is_auto_managed()):
|
||||||
self.update_state()
|
self.handle.auto_managed(auto_managed)
|
||||||
|
self.update_state()
|
||||||
|
|
||||||
def set_stop_ratio(self, stop_ratio):
|
def set_stop_ratio(self, stop_ratio):
|
||||||
self.options["stop_ratio"] = stop_ratio
|
self.options["stop_ratio"] = stop_ratio
|
||||||
|
|
|
@ -327,6 +327,8 @@ class TorrentManager(component.Component):
|
||||||
return
|
return
|
||||||
|
|
||||||
log.debug("handle id: %s", str(handle.info_hash()))
|
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
|
# Create a Torrent object
|
||||||
torrent = Torrent(handle, options, state, filename)
|
torrent = Torrent(handle, options, state, filename)
|
||||||
# Add the torrent object to the dictionary
|
# Add the torrent object to the dictionary
|
||||||
|
@ -338,8 +340,7 @@ class TorrentManager(component.Component):
|
||||||
|
|
||||||
# Resume the torrent if needed
|
# Resume the torrent if needed
|
||||||
if not options["add_paused"]:
|
if not options["add_paused"]:
|
||||||
handle.resume()
|
torrent.resume()
|
||||||
handle.auto_managed(options["auto_managed"])
|
|
||||||
|
|
||||||
# Write the .torrent file to the state directory
|
# Write the .torrent file to the state directory
|
||||||
if filedump:
|
if filedump:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue