Remove reverse dependency on the stored playlists controller
This commit is contained in:
parent
061c155f1e
commit
5dd67fa7a7
@ -58,10 +58,10 @@ class SpotifyBackend(ThreadingActor, base.Backend):
|
|||||||
self.playback = core.PlaybackController(backend=self,
|
self.playback = core.PlaybackController(backend=self,
|
||||||
provider=playback_provider)
|
provider=playback_provider)
|
||||||
|
|
||||||
stored_playlists_provider = SpotifyStoredPlaylistsProvider(
|
self.stored_playlists_provider = SpotifyStoredPlaylistsProvider(
|
||||||
backend=self)
|
backend=self)
|
||||||
self.stored_playlists = core.StoredPlaylistsController(backend=self,
|
self.stored_playlists = core.StoredPlaylistsController(backend=self,
|
||||||
provider=stored_playlists_provider)
|
provider=self.stored_playlists_provider)
|
||||||
|
|
||||||
self.uri_schemes = [u'spotify']
|
self.uri_schemes = [u'spotify']
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@ class SpotifyLibraryProvider(BaseLibraryProvider):
|
|||||||
# Since we can't search for the entire Spotify library, we return
|
# Since we can't search for the entire Spotify library, we return
|
||||||
# all tracks in the stored playlists when the query is empty.
|
# all tracks in the stored playlists when the query is empty.
|
||||||
tracks = []
|
tracks = []
|
||||||
for playlist in self.backend.stored_playlists.playlists:
|
for playlist in self.backend.stored_playlists_provider.playlists:
|
||||||
tracks += playlist.tracks
|
tracks += playlist.tracks
|
||||||
return Playlist(tracks=tracks)
|
return Playlist(tracks=tracks)
|
||||||
spotify_query = []
|
spotify_query = []
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class SpotifySessionManager(BaseThread, PyspotifySessionManager):
|
|||||||
playlists = map(SpotifyTranslator.to_mopidy_playlist,
|
playlists = map(SpotifyTranslator.to_mopidy_playlist,
|
||||||
self.session.playlist_container())
|
self.session.playlist_container())
|
||||||
playlists = filter(None, playlists)
|
playlists = filter(None, playlists)
|
||||||
self.backend.stored_playlists.playlists = playlists
|
self.backend.stored_playlists_provider.playlists = playlists
|
||||||
logger.info(u'Loaded %d Spotify playlist(s)', len(playlists))
|
logger.info(u'Loaded %d Spotify playlist(s)', len(playlists))
|
||||||
|
|
||||||
def search(self, query, queue):
|
def search(self, query, queue):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user