From 32b01f4e4aba65ef7e11fe27378e13d04d65f3d8 Mon Sep 17 00:00:00 2001 From: Javier Domingo Cansino Date: Tue, 5 Nov 2013 13:17:55 +0100 Subject: [PATCH] Adding a 'to list' conversion and correcting horrible mistake in comparison (put it reverse) --- mopidy/core/tracklist.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mopidy/core/tracklist.py b/mopidy/core/tracklist.py index 9f7d40ee..002b0d0d 100644 --- a/mopidy/core/tracklist.py +++ b/mopidy/core/tracklist.py @@ -317,11 +317,13 @@ class TracklistController(object): criteria = criteria or kwargs matches = self._tl_tracks for (key, value) in criteria.iteritems(): + if not type(value) is list: + value = [value] if key == 'tlid': - matches = filter(lambda ct: value in ct.tlid, matches) + matches = filter(lambda ct: ct.tlid in value, matches) else: matches = filter( - lambda ct: value in getattr(ct.track, key), matches) + lambda ct: getattr(ct.track, key) in value, matches) return matches def move(self, start, end, to_position):