mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 03:55:43 +00:00
[#3080] Fix torrent reappearing on restart
If a magnet is added to new Deluge state, then deleted, it will reappear on restart. The problem results from torrents requiring both state and torrent file but magnet only rely on the state file and the save_state code not saving if the torrent list is empty. So torrents won't be loaded as their torrent files have been deleted but magnets details remain in state file and are loaded again on restart. The fix is to always save the state file even if the state is empty.
This commit is contained in:
parent
abf4c345f0
commit
d8b1e2701c
@ -858,9 +858,6 @@ class TorrentManager(component.Component):
|
|||||||
def _save_state(self):
|
def _save_state(self):
|
||||||
"""Save the state of the TorrentManager to the torrents.state file."""
|
"""Save the state of the TorrentManager to the torrents.state file."""
|
||||||
state = self.create_state()
|
state = self.create_state()
|
||||||
if not state.torrents:
|
|
||||||
log.debug('Skipping saving state with no torrents loaded')
|
|
||||||
return
|
|
||||||
|
|
||||||
# If the state hasn't changed, no need to save it
|
# If the state hasn't changed, no need to save it
|
||||||
if self.prev_saved_state == state:
|
if self.prev_saved_state == state:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user