Fix getting a torrent's status with an empty key list to return all the

torrent's status keys instead of an empty dict
This commit is contained in:
Andrew Resch 2010-08-06 17:26:23 -07:00
parent d49cde1994
commit 4d0560eff2
1 changed files with 5 additions and 1 deletions

View File

@ -96,7 +96,11 @@ class SessionProxy(component.Component):
""" """
sd = {} sd = {}
for torrent_id in torrent_ids: for torrent_id in torrent_ids:
sd[torrent_id] = dict([(x, y) for x, y in self.torrents[torrent_id][1].iteritems() if x in keys]) if keys:
sd[torrent_id] = dict([(x, y) for x, y in self.torrents[torrent_id][1].iteritems() if x in keys])
else:
sd[torrent_id] = dict(self.torrents[torrent_id][1])
return sd return sd
def get_torrent_status(self, torrent_id, keys): def get_torrent_status(self, torrent_id, keys):