backends: Make search/find_exact accept 'uris' kwarg
This commit is contained in:
parent
1704828504
commit
c54db3298f
@ -53,7 +53,7 @@ class BaseLibraryProvider(object):
|
||||
def __init__(self, backend):
|
||||
self.backend = backend
|
||||
|
||||
def find_exact(self, query=None):
|
||||
def find_exact(self, query=None, uris=None):
|
||||
"""
|
||||
See :meth:`mopidy.core.LibraryController.find_exact`.
|
||||
|
||||
@ -77,7 +77,7 @@ class BaseLibraryProvider(object):
|
||||
"""
|
||||
pass
|
||||
|
||||
def search(self, query=None):
|
||||
def search(self, query=None, uris=None):
|
||||
"""
|
||||
See :meth:`mopidy.core.LibraryController.search`.
|
||||
|
||||
|
||||
@ -35,7 +35,9 @@ class LocalLibraryProvider(base.BaseLibraryProvider):
|
||||
logger.debug('Failed to lookup %r', uri)
|
||||
return []
|
||||
|
||||
def find_exact(self, query=None):
|
||||
def find_exact(self, query=None, uris=None):
|
||||
# TODO Only return results within URI roots given by ``uris``
|
||||
|
||||
if query is None:
|
||||
query = {}
|
||||
self._validate_query(query)
|
||||
@ -74,7 +76,9 @@ class LocalLibraryProvider(base.BaseLibraryProvider):
|
||||
raise LookupError('Invalid lookup field: %s' % field)
|
||||
return SearchResult(uri='file:search', tracks=result_tracks)
|
||||
|
||||
def search(self, query=None):
|
||||
def search(self, query=None, uris=None):
|
||||
# TODO Only return results within URI roots given by ``uris``
|
||||
|
||||
if query is None:
|
||||
query = {}
|
||||
self._validate_query(query)
|
||||
|
||||
@ -62,8 +62,8 @@ class SpotifyTrack(Track):
|
||||
|
||||
|
||||
class SpotifyLibraryProvider(base.BaseLibraryProvider):
|
||||
def find_exact(self, query=None):
|
||||
return self.search(query=query)
|
||||
def find_exact(self, query=None, uris=None):
|
||||
return self.search(query=query, uris=uris)
|
||||
|
||||
def lookup(self, uri):
|
||||
try:
|
||||
@ -131,7 +131,9 @@ class SpotifyLibraryProvider(base.BaseLibraryProvider):
|
||||
def refresh(self, uri=None):
|
||||
pass # TODO
|
||||
|
||||
def search(self, query=None):
|
||||
def search(self, query=None, uris=None):
|
||||
# TODO Only return results within URI roots given by ``uris``
|
||||
|
||||
if not query:
|
||||
return self._get_all_tracks()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user