Merge pull request #1362 from tkem/feature/playlists-schemes
core: Add PlaylistsController.get_uri_schemes().
This commit is contained in:
commit
2a04088544
@ -161,6 +161,8 @@ Playlists controller
|
||||
|
||||
.. class:: mopidy.core.PlaylistsController
|
||||
|
||||
.. automethod:: mopidy.core.PlaylistsController.get_uri_schemes
|
||||
|
||||
Fetching
|
||||
--------
|
||||
|
||||
|
||||
@ -20,6 +20,9 @@ Core API
|
||||
seek target while a seek is in progress. This gives better results than just
|
||||
failing the position query. (Fixes: :issue:`312` PR: :issue:`1346`)
|
||||
|
||||
- Add :meth:`mopidy.core.PlaylistsController.get_uri_schemes`. (PR:
|
||||
:issue:`1362`)
|
||||
|
||||
Models
|
||||
------
|
||||
|
||||
|
||||
@ -33,6 +33,16 @@ class PlaylistsController(object):
|
||||
self.backends = backends
|
||||
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):
|
||||
"""
|
||||
Get a list of the currently available playlists.
|
||||
|
||||
@ -248,6 +248,10 @@ class PlaylistTest(BasePlaylistsTest):
|
||||
self.assertFalse(self.sp1.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):
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user