mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 07:28:39 +00:00
[Core] Supress warnings with fresh config
* Test TMState has torrents before attempting old state update. * Only warn about missing fastresume if torrents in session.
This commit is contained in:
parent
69a1f5f210
commit
639eefcf1d
1 changed files with 3 additions and 2 deletions
|
@ -653,7 +653,7 @@ class TorrentManager(component.Component):
|
||||||
# Try to use an old state
|
# Try to use an old state
|
||||||
try:
|
try:
|
||||||
state_tmp = TorrentState()
|
state_tmp = TorrentState()
|
||||||
if dir(state.torrents[0]) != dir(state_tmp):
|
if state.torrents and dir(state.torrents[0]) != dir(state_tmp):
|
||||||
for attr in (set(dir(state_tmp)) - set(dir(state.torrents[0]))):
|
for attr in (set(dir(state_tmp)) - set(dir(state.torrents[0]))):
|
||||||
for s in state.torrents:
|
for s in state.torrents:
|
||||||
setattr(s, attr, getattr(state_tmp, attr, None))
|
setattr(s, attr, getattr(state_tmp, attr, None))
|
||||||
|
@ -772,6 +772,7 @@ class TorrentManager(component.Component):
|
||||||
resume_data = lt.bdecode(fastresume_file.read())
|
resume_data = lt.bdecode(fastresume_file.read())
|
||||||
fastresume_file.close()
|
fastresume_file.close()
|
||||||
except (EOFError, IOError, Exception), e:
|
except (EOFError, IOError, Exception), e:
|
||||||
|
if self.torrents:
|
||||||
log.warning("Unable to load fastresume file: %s", e)
|
log.warning("Unable to load fastresume file: %s", e)
|
||||||
resume_data = None
|
resume_data = None
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue