Fix displaying errors when a torrent is Checking

This commit is contained in:
Andrew Resch 2009-02-06 07:13:56 +00:00
parent 76f56957ce
commit 79e6ecfbac
2 changed files with 12 additions and 6 deletions

View file

@ -2,6 +2,7 @@ Deluge 1.1.3 - (In Development)
Misc:
* Fix issue when initializing gettext that would prevent deluge from starting
* Fix logging exceptions when starting the daemon
* Fix displaying errors when a torrent is Checking
Deluge 1.1.2 - (31 January 2009)
Core:

View file

@ -354,6 +354,16 @@ class Torrent:
log.debug("set_state_based_on_ltstate: %s", deluge.common.LT_TORRENT_STATE[ltstate])
log.debug("session.is_paused: %s", component.get("Core").session.is_paused())
# First we check for an error from libtorrent, and set the state to that
# if any occurred.
if self.handle.is_paused() and len(self.handle.status().error) > 0:
# This is an error'd torrent
self.state = "Error"
self.set_status_message(self.handle.status().error)
self.handle.auto_managed(False)
return
if ltstate == LTSTATE["Queued"] or ltstate == LTSTATE["Checking"]:
self.state = "Checking"
return
@ -364,12 +374,7 @@ class Torrent:
elif ltstate == LTSTATE["Allocating"]:
self.state = "Allocating"
if self.handle.is_paused() and len(self.handle.status().error) > 0:
# This is an error'd torrent
self.state = "Error"
self.set_status_message(self.handle.status().error)
self.handle.auto_managed(False)
elif self.handle.is_paused() and self.handle.is_auto_managed() and not component.get("Core").session.is_paused():
if self.handle.is_paused() and self.handle.is_auto_managed() and not component.get("Core").session.is_paused():
self.state = "Queued"
elif component.get("Core").session.is_paused() or (self.handle.is_paused() and not self.handle.is_auto_managed()):
self.state = "Paused"