From 71bae709ef3143ff00f1b0f7b11385984bc11cc2 Mon Sep 17 00:00:00 2001 From: Javier Domingo Cansino Date: Thu, 7 Nov 2013 11:05:33 +0100 Subject: [PATCH] core: filter() to accept also tuples --- mopidy/core/tracklist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mopidy/core/tracklist.py b/mopidy/core/tracklist.py index 584a8bb9..012dd796 100644 --- a/mopidy/core/tracklist.py +++ b/mopidy/core/tracklist.py @@ -291,7 +291,7 @@ class TracklistController(object): def filter(self, criteria=None, **kwargs): """ Filter the tracklist by the given criterias. The value of the field to - check can be a list or a set. + check can be a list, a tuple or a set. Examples:: @@ -334,7 +334,7 @@ class TracklistController(object): criteria = criteria or kwargs matches = self._tl_tracks for (key, value) in criteria.iteritems(): - if not type(value) in [list, set]: + if not type(value) in [list, tuple, set]: value = [value] if key == 'tlid': matches = filter(lambda ct: ct.tlid in value, matches)