From d8b1e2701c897aa0d26bdf8f82e59b66ea1488cd Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 27 Sep 2018 10:56:56 +0100 Subject: [PATCH] [#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. --- deluge/core/torrentmanager.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 484218ad4..961ad0f19 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -858,9 +858,6 @@ class TorrentManager(component.Component): def _save_state(self): """Save the state of the TorrentManager to the torrents.state file.""" 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 self.prev_saved_state == state: