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