From 0e60730704d4810fe40e3eaf85639dc5b004ee54 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 29 Aug 2014 13:48:01 +0200 Subject: [PATCH] backends: Update browse() signature and docs to match core implementation Fixes #833 --- docs/changelog.rst | 4 ++++ mopidy/backend/__init__.py | 4 ++-- mopidy/local/__init__.py | 6 +++--- mopidy/local/library.py | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index e242b989..6ef9393e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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) ==================== diff --git a/mopidy/backend/__init__.py b/mopidy/backend/__init__.py index 317cf762..b8e37cb2 100644 --- a/mopidy/backend/__init__.py +++ b/mopidy/backend/__init__.py @@ -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.* """ diff --git a/mopidy/local/__init__.py b/mopidy/local/__init__.py index 8b4a8b1f..da4d8a55 100644 --- a/mopidy/local/__init__.py +++ b/mopidy/local/__init__.py @@ -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 diff --git a/mopidy/local/library.py b/mopidy/local/library.py index a626f566..65aa4268 100644 --- a/mopidy/local/library.py +++ b/mopidy/local/library.py @@ -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: