Fix previous fix for non-present key in cache.
This commit is contained in:
parent
e069542e3a
commit
24471624c2
|
@ -299,14 +299,18 @@ class TorrentView(listview.ListView, component.Component):
|
||||||
# This is to prevent updating stuff we don't need to and should save
|
# This is to prevent updating stuff we don't need to and should save
|
||||||
# GTK from redrawing needlessly.
|
# GTK from redrawing needlessly.
|
||||||
new_status = {}
|
new_status = {}
|
||||||
|
|
||||||
for torrent_id in status.keys():
|
for torrent_id in status.keys():
|
||||||
if torrent_id in self.previous_batched_status.keys():
|
if torrent_id in self.previous_batched_status.keys():
|
||||||
old = self.previous_batched_status[torrent_id]
|
old = self.previous_batched_status[torrent_id]
|
||||||
new = status[torrent_id]
|
new = status[torrent_id]
|
||||||
|
|
||||||
diff = {}
|
diff = {}
|
||||||
for key in new.keys():
|
for key in new.keys():
|
||||||
if not key in old.keys():
|
if not key in old.keys():
|
||||||
|
diff[key] = new[key]
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# There is a difference, so lets add it to our new dict
|
# There is a difference, so lets add it to our new dict
|
||||||
if new[key] != old[key]:
|
if new[key] != old[key]:
|
||||||
diff[key] = new[key]
|
diff[key] = new[key]
|
||||||
|
|
Loading…
Reference in New Issue