core: Add PlaylistsController.get_uri_schemes().
This commit is contained in:
parent
ede5b8abff
commit
ef1468d8d6
@ -161,6 +161,8 @@ Playlists controller
|
|||||||
|
|
||||||
.. class:: mopidy.core.PlaylistsController
|
.. class:: mopidy.core.PlaylistsController
|
||||||
|
|
||||||
|
.. automethod:: mopidy.core.PlaylistsController.get_uri_schemes
|
||||||
|
|
||||||
Fetching
|
Fetching
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,9 @@ Core API
|
|||||||
seek target while a seek is in progress. This gives better results than just
|
seek target while a seek is in progress. This gives better results than just
|
||||||
failing the position query. (Fixes: :issue:`312` PR: :issue:`1346`)
|
failing the position query. (Fixes: :issue:`312` PR: :issue:`1346`)
|
||||||
|
|
||||||
|
- Add :meth:`mopidy.core.PlaylistsController.get_uri_schemes`. (PR:
|
||||||
|
:issue:`1362`)
|
||||||
|
|
||||||
Models
|
Models
|
||||||
------
|
------
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,16 @@ class PlaylistsController(object):
|
|||||||
self.backends = backends
|
self.backends = backends
|
||||||
self.core = core
|
self.core = core
|
||||||
|
|
||||||
|
def get_uri_schemes(self):
|
||||||
|
"""
|
||||||
|
Get the list of URI schemes that support playlists.
|
||||||
|
|
||||||
|
:rtype: list of string
|
||||||
|
|
||||||
|
.. versionadded:: 1.2
|
||||||
|
"""
|
||||||
|
return list(sorted(self.backends.with_playlists.keys()))
|
||||||
|
|
||||||
def as_list(self):
|
def as_list(self):
|
||||||
"""
|
"""
|
||||||
Get a list of the currently available playlists.
|
Get a list of the currently available playlists.
|
||||||
|
|||||||
@ -248,6 +248,10 @@ class PlaylistTest(BasePlaylistsTest):
|
|||||||
self.assertFalse(self.sp1.save.called)
|
self.assertFalse(self.sp1.save.called)
|
||||||
self.assertFalse(self.sp2.save.called)
|
self.assertFalse(self.sp2.save.called)
|
||||||
|
|
||||||
|
def test_get_uri_schemes(self):
|
||||||
|
result = self.core.playlists.get_uri_schemes()
|
||||||
|
self.assertEquals(result, ['dummy1', 'dummy2'])
|
||||||
|
|
||||||
|
|
||||||
class DeprecatedFilterPlaylistsTest(BasePlaylistsTest):
|
class DeprecatedFilterPlaylistsTest(BasePlaylistsTest):
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user