Module: deluge
Branch: chunked-sessionproxy-and-gtkui-speedups
Commit: d9fa63f5111e298a2f60d42a5ccaa5f4f971a656

Author: Pedro Algarvio <pe...@algarvio.me>
Date:   Tue May 17 19:16:23 2011 +0100

Don't fail if we still don't have full statuses.

---

 deluge/ui/sessionproxy.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/deluge/ui/sessionproxy.py b/deluge/ui/sessionproxy.py
index 29ce7b3..9704c59 100644
--- a/deluge/ui/sessionproxy.py
+++ b/deluge/ui/sessionproxy.py
@@ -269,8 +269,8 @@ class SessionProxy(component.Component):
 
     def on_torrent_state_changed(self, torrent_id, state):
         if torrent_id in self.torrents:
-            self.torrents[torrent_id][1]["state"] = state
-            self.cache_times[torrent_id]["state"] = time.time()
+            self.torrents[torrent_id][1].setdefault("state", state)
+            self.cache_times.setdefault(torrent_id, 
{}).update(state=time.time())
 
     def on_torrent_added(self, torrent_id, from_state):
         self.torrents[torrent_id] = [time.time() - self.cache_time - 1, {}]

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to deluge-commit@googlegroups.com.
To unsubscribe from this group, send email to 
deluge-commit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to