backend: Remove playlists.playlists property

This commit is contained in:
Stein Magnus Jodal 2015-03-23 00:32:19 +01:00
parent e3f2e368c7
commit d37bd62bb1
3 changed files with 11 additions and 25 deletions

View File

@ -94,7 +94,7 @@ v1.0.0 (UNRELEASED)
:attr:`mopidy.backend.PlaylistsProvider.playlists`. This is potentially :attr:`mopidy.backend.PlaylistsProvider.playlists`. This is potentially
backwards incompatible. (PR: :issue:`1046`) 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 change is **not** backwards compatible for certain backends. These changes
are crucial to adding gapless in one of the upcoming releases. are crucial to adding gapless in one of the upcoming releases.
(Fixes: :issue:`1052`, PR: :issue:`1064`) (Fixes: :issue:`1052`, PR: :issue:`1064`)
@ -113,6 +113,16 @@ v1.0.0 (UNRELEASED)
- :meth:`mopidy.backend.PlaybackProvider.prepare_change` has been added. - :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** **Commands**
- Make the ``mopidy`` command print a friendly error message if the - Make the ``mopidy`` command print a friendly error message if the

View File

@ -300,24 +300,6 @@ class PlaylistsProvider(object):
def __init__(self, backend): def __init__(self, backend):
self.backend = 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): def as_list(self):
""" """
Get a list of the currently available playlists. Get a list of the currently available playlists.

View File

@ -36,12 +36,6 @@ class PlaylistsTest(unittest.TestCase):
def setUp(self): # noqa: N802 def setUp(self): # noqa: N802
self.provider = backend.PlaylistsProvider(backend=None) 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): def test_as_list_default_impl(self):
with self.assertRaises(NotImplementedError): with self.assertRaises(NotImplementedError):
self.provider.as_list() self.provider.as_list()