Skip to content

Commit

Permalink
local: Filter out None from get_distinct results
Browse files Browse the repository at this point in the history
Fixes #1202
  • Loading branch information
jodal committed Jul 22, 2015
1 parent b32db58 commit 131d992
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/changelog.rst
Expand Up @@ -80,6 +80,13 @@ MPD frontend
- Track data now include the ``Last-Modified`` field if set on the track model.
(Fixes: :issue:`1218`, PR: :issue:`1219`)

Local backend
-------------

- Filter out :class:`None` from
:meth:`~mopidy.backend.LibraryProvider.get_distinct` results. All returned
results should be strings. (Fixes: :issue:`1202`)

File backend
------------

Expand Down
2 changes: 1 addition & 1 deletion mopidy/local/json.py
Expand Up @@ -174,7 +174,7 @@ def distinct(track):
search_result = search.search(self._tracks.values(), query, limit=None)
for track in search_result.tracks:
distinct_result.update(distinct(track))
return distinct_result
return distinct_result - {None}

def search(self, query=None, limit=100, offset=0, uris=None, exact=False):
tracks = self._tracks.values()
Expand Down

0 comments on commit 131d992

Please sign in to comment.