diff options
author | Andrew Resch <andrewresch@gmail.com> | 2009-02-06 07:13:56 +0000 |
---|---|---|
committer | Andrew Resch <andrewresch@gmail.com> | 2009-02-06 07:13:56 +0000 |
commit | 79e6ecfbacd98998ce29277a88e2bfe7f104fe1c (patch) | |
tree | 28cac32bcf0766bd8ec42b82009c299163b8cea3 | |
parent | 76f56957ce918d32b5151f064f2e04fccfd0668e (diff) | |
download | deluge-79e6ecfbacd98998ce29277a88e2bfe7f104fe1c.tar.gz deluge-79e6ecfbacd98998ce29277a88e2bfe7f104fe1c.tar.bz2 deluge-79e6ecfbacd98998ce29277a88e2bfe7f104fe1c.zip |
Fix displaying errors when a torrent is Checking
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | deluge/core/torrent.py | 17 |
2 files changed, 12 insertions, 6 deletions
@@ -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: diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 7b7ceb872..a55288ed6 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -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" |