mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 13:56:47 +00:00
First change outside of deluge/ui/console - fixed a problem when removing torrents
This commit is contained in:
parent
76babd951d
commit
78137540f2
@ -113,6 +113,7 @@ class SessionProxy(component.Component):
|
|||||||
"""
|
"""
|
||||||
sd = {}
|
sd = {}
|
||||||
for torrent_id in torrent_ids:
|
for torrent_id in torrent_ids:
|
||||||
|
try:
|
||||||
if keys:
|
if keys:
|
||||||
sd[torrent_id] = dict([
|
sd[torrent_id] = dict([
|
||||||
(x, y) for x, y in self.torrents[torrent_id][1].iteritems()
|
(x, y) for x, y in self.torrents[torrent_id][1].iteritems()
|
||||||
@ -120,6 +121,8 @@ class SessionProxy(component.Component):
|
|||||||
])
|
])
|
||||||
else:
|
else:
|
||||||
sd[torrent_id] = dict(self.torrents[torrent_id][1])
|
sd[torrent_id] = dict(self.torrents[torrent_id][1])
|
||||||
|
except KeyError:
|
||||||
|
continue
|
||||||
|
|
||||||
return sd
|
return sd
|
||||||
|
|
||||||
@ -195,10 +198,14 @@ class SessionProxy(component.Component):
|
|||||||
# Update the internal torrent status dict with the update values
|
# Update the internal torrent status dict with the update values
|
||||||
t = time.time()
|
t = time.time()
|
||||||
for key, value in result.items():
|
for key, value in result.items():
|
||||||
|
try:
|
||||||
self.torrents[key][0] = t
|
self.torrents[key][0] = t
|
||||||
self.torrents[key][1].update(value)
|
self.torrents[key][1].update(value)
|
||||||
for k in value:
|
for k in value:
|
||||||
self.cache_times[key][k] = t
|
self.cache_times[key][k] = t
|
||||||
|
except KeyError:
|
||||||
|
#The torrent was removed
|
||||||
|
continue
|
||||||
|
|
||||||
# Create the status dict
|
# Create the status dict
|
||||||
if not torrent_ids:
|
if not torrent_ids:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user