core: Trigger playlists_loaded() after playlist refresh
This commit is contained in:
parent
5526ee5a95
commit
426d5aea16
@ -132,11 +132,13 @@ class PlaylistsController(object):
|
||||
futures = [
|
||||
b.playlists.refresh() for b in self.backends.with_playlists]
|
||||
pykka.get_all(futures)
|
||||
listener.CoreListener.send('playlists_loaded')
|
||||
else:
|
||||
backend = self.backends.with_playlists_by_uri_scheme.get(
|
||||
uri_scheme, None)
|
||||
if backend:
|
||||
backend.playlists.refresh().get()
|
||||
listener.CoreListener.send('playlists_loaded')
|
||||
|
||||
def save(self, playlist):
|
||||
"""
|
||||
|
||||
@ -91,11 +91,15 @@ class BackendEventsTest(unittest.TestCase):
|
||||
self.core.tracklist.shuffle().get()
|
||||
self.assertEqual(send.call_args[0][0], 'tracklist_changed')
|
||||
|
||||
@unittest.SkipTest
|
||||
def test_playlists_load_sends_playlists_loaded_event(self, send):
|
||||
# TODO Figure out what type of event and how to send events when
|
||||
# the backend finished loading playlists
|
||||
pass
|
||||
def test_playlists_refresh_sends_playlists_loaded_event(self, send):
|
||||
send.reset_mock()
|
||||
self.core.playlists.refresh().get()
|
||||
self.assertEqual(send.call_args[0][0], 'playlists_loaded')
|
||||
|
||||
def test_playlists_refresh_uri_sends_playlists_loaded_event(self, send):
|
||||
send.reset_mock()
|
||||
self.core.playlists.refresh(uri_scheme='dummy').get()
|
||||
self.assertEqual(send.call_args[0][0], 'playlists_loaded')
|
||||
|
||||
def test_playlists_create_sends_playlist_changed_event(self, send):
|
||||
send.reset_mock()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user