core: Letting filter() accept lists

This commit is contained in:
Javier Domingo Cansino 2013-11-05 13:05:05 +01:00
parent 590de1e9a9
commit 808770733f

View File

@ -318,10 +318,10 @@ class TracklistController(object):
matches = self._tl_tracks
for (key, value) in criteria.iteritems():
if key == 'tlid':
matches = filter(lambda ct: ct.tlid == value, matches)
matches = filter(lambda ct: value in ct.tlid, matches)
else:
matches = filter(
lambda ct: getattr(ct.track, key) == value, matches)
lambda ct: value in getattr(ct.track, key), matches)
return matches
def move(self, start, end, to_position):