backends: Update browse() signature and docs to match core implementation

Fixes #833
This commit is contained in:
Stein Magnus Jodal 2014-08-29 13:48:01 +02:00
parent 2830784703
commit 0e60730704
4 changed files with 11 additions and 7 deletions

View File

@ -24,6 +24,10 @@ Bug fix release.
- Network: Fix a race condition where two threads could try to free the same
data simultaneously. (Fixes: :issue:`781`)
- Backend API: Update :meth:`mopidy.backend.LibraryProvider.browse` signature
and docs to match how the core use the backend's browse method. (Fixes:
:issue:`833`)
v0.19.3 (2014-08-03)
====================

View File

@ -81,12 +81,12 @@ class LibraryProvider(object):
def __init__(self, backend):
self.backend = backend
def browse(self, path):
def browse(self, uri):
"""
See :meth:`mopidy.core.LibraryController.browse`.
If you implement this method, make sure to also set
:attr:`root_directory_name`.
:attr:`root_directory`.
*MAY be implemented by subclass.*
"""

View File

@ -64,11 +64,11 @@ class Library(object):
def __init__(self, config):
self._config = config
def browse(self, path):
def browse(self, uri):
"""
Browse directories and tracks at the given path.
Browse directories and tracks at the given URI.
:param string path: path to browse or None for root.
:param string path: URI to browse.
:rtype: List of :class:`~mopidy.models.Ref` tracks and directories.
"""
raise NotImplementedError

View File

@ -18,10 +18,10 @@ class LocalLibraryProvider(backend.LibraryProvider):
self._library = library
self.refresh()
def browse(self, path):
def browse(self, uri):
if not self._library:
return []
return self._library.browse(path)
return self._library.browse(uri)
def refresh(self, uri=None):
if not self._library: