diff --git a/docs/changelog.rst b/docs/changelog.rst index 0fdcaa16..5d68143d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -94,7 +94,7 @@ v1.0.0 (UNRELEASED) :attr:`mopidy.backend.PlaylistsProvider.playlists`. This is potentially backwards incompatible. (PR: :issue:`1046`) -- Changed the API for :class:`mopidy.backend.PlaybackProvider`, note that this +- Changed the API for :class:`mopidy.backend.PlaybackProvider`. Note that this change is **not** backwards compatible for certain backends. These changes are crucial to adding gapless in one of the upcoming releases. (Fixes: :issue:`1052`, PR: :issue:`1064`) @@ -113,6 +113,16 @@ v1.0.0 (UNRELEASED) - :meth:`mopidy.backend.PlaybackProvider.prepare_change` has been added. +- Changed the API for :class:`mopidy.backend.PlaylistsProvider`. Note that this + change is **not** backwards compatible. These changes are important to reduce + the Mopidy startup time. (Fixes: :issue:`1057`, PR: :issue:`1075`) + + - Add :meth:`mopidy.backend.PlaylistsProvider.as_list`. + + - Add :meth:`mopidy.backend.PlaylistsProvider.get_items`. + + - Remove :attr:`mopidy.backend.PlaylistsProvider.playlists` property. + **Commands** - Make the ``mopidy`` command print a friendly error message if the diff --git a/mopidy/backend.py b/mopidy/backend.py index c1554c7f..02a624d9 100644 --- a/mopidy/backend.py +++ b/mopidy/backend.py @@ -300,24 +300,6 @@ class PlaylistsProvider(object): def __init__(self, backend): self.backend = backend - # TODO Replace playlists property with a get_playlists() method which - # returns playlist Ref's instead of the gigantic data structures we - # currently make available. lookup() should be used for getting full - # playlists with all details. - - @property - def playlists(self): - """ - Currently available playlists. - - Read/write. List of :class:`mopidy.models.Playlist`. - """ - return [] - - @playlists.setter # noqa - def playlists(self, playlists): - raise NotImplementedError - def as_list(self): """ Get a list of the currently available playlists. diff --git a/tests/backend/test_backend.py b/tests/backend/test_backend.py index 23cfedd5..e6aac76f 100644 --- a/tests/backend/test_backend.py +++ b/tests/backend/test_backend.py @@ -36,12 +36,6 @@ class PlaylistsTest(unittest.TestCase): def setUp(self): # noqa: N802 self.provider = backend.PlaylistsProvider(backend=None) - def test_playlists_default_impl(self): - self.assertEqual(self.provider.playlists, []) - - with self.assertRaises(NotImplementedError): - self.provider.playlists = [] - def test_as_list_default_impl(self): with self.assertRaises(NotImplementedError): self.provider.as_list()