summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2015-10-29 13:42:07 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2015-10-30 15:35:47 +0100
commitf4dce731e9924ce4f4d9ad8a9db6d903e934bd1c (patch)
treeb09d46528578e7d464ae7d0ceb8fdbabe9aa004a
parent[Console] Use utf8_encoded for non-interactive mode (diff)
downloaddeluge-f4dce731e9924ce4f4d9ad8a9db6d903e934bd1c.tar.xz
deluge-f4dce731e9924ce4f4d9ad8a9db6d903e934bd1c.zip
[Core] Supress state warnings with fresh config
-rw-r--r--deluge/core/torrentmanager.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
index 92bbdf286..ff7d4390a 100644
--- a/deluge/core/torrentmanager.py
+++ b/deluge/core/torrentmanager.py
@@ -742,7 +742,8 @@ class TorrentManager(component.Component):
with open(_filepath, "rb") as _file:
resume_data = lt.bdecode(_file.read())
except (IOError, EOFError, RuntimeError) as ex:
- log.warning("Unable to load %s: %s", _filepath, ex)
+ if self.torrents:
+ log.warning("Unable to load %s: %s", _filepath, ex)
resume_data = None
else:
log.info("Successfully loaded %s: %s", filename, _filepath)
@@ -756,6 +757,9 @@ class TorrentManager(component.Component):
def save_resume_data_file(self):
"""Saves the resume data file with the contents of self.resume_data"""
+ if not self.resume_data:
+ return True
+
filename = "torrents.fastresume"
filepath = os.path.join(self.state_dir, filename)
filepath_bak = filepath + ".bak"