Use torrent state name instead of number if available

This commit is contained in:
Andrew Resch 2010-07-02 18:09:21 -07:00
parent 504751424f
commit 3cd30ea96a
1 changed files with 14 additions and 12 deletions

View File

@ -341,7 +341,10 @@ class Torrent(object):
# Set self.state to the ltstate right away just incase we don't hit some
# of the logic below
self.state = str(ltstate)
if ltstate in LTSTATE:
self.state = LTSTATE[ltstate]
else:
self.state = str(ltstate)
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())
@ -899,4 +902,3 @@ class Torrent(object):
for key in self.prev_status.keys():
if not self.rpcserver.is_session_valid(key):
del self.prev_status[key]