Skip to content

Commit

Permalink
library: Add exact kwarg to search()
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Mar 25, 2015
1 parent 3f76e75 commit e6a6949
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ v1.0.0 (UNRELEASED)

- Update to work with new playback API in Mopidy 1.0

- Update to work with new search API in Mopidy 1.0

v0.3.1 (2014-01-28)
-------------------

Expand Down
7 changes: 5 additions & 2 deletions mopidy_subsonic/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self, *args, **kwargs):
super(SubsonicLibraryProvider, self).__init__(*args, **kwargs)
self.remote = self.backend.remote

def find_exact(self, query=None, uris=None):
def _find_exact(self, query=None, uris=None):
if not query:
# Fetch all artists(browse library)
return SearchResult(
Expand All @@ -26,7 +26,10 @@ def find_exact(self, query=None, uris=None):
tracks=self.remote.get_tracks_by(
query.get('artist'), query.get('album')))

def search(self, query=None, uris=None):
def search(self, query=None, uris=None, exact=False):
if exact:
return self._find_exact(query=query, uris=uris)

logger.debug('Query "%s":' % query)

artist, album, title, any = None, None, None, None
Expand Down

0 comments on commit e6a6949

Please sign in to comment.