Refactor from nested list comprehensions to map/filter
This commit is contained in:
parent
f0f10e4374
commit
7fa46f1ace
@ -139,11 +139,9 @@ class SpotifySessionManager(BaseThread, PyspotifySessionManager):
|
|||||||
def refresh_stored_playlists(self):
|
def refresh_stored_playlists(self):
|
||||||
"""Refresh the stored playlists in the backend with fresh meta data
|
"""Refresh the stored playlists in the backend with fresh meta data
|
||||||
from Spotify"""
|
from Spotify"""
|
||||||
playlists = [playlist
|
playlists = map(SpotifyTranslator.to_mopidy_playlist,
|
||||||
for playlist in
|
self.session.playlist_container())
|
||||||
[SpotifyTranslator.to_mopidy_playlist(spotify_playlist)
|
playlists = filter(None, playlists)
|
||||||
for spotify_playlist in self.session.playlist_container()]
|
|
||||||
if playlist is not None]
|
|
||||||
self.backend.stored_playlists.playlists = playlists
|
self.backend.stored_playlists.playlists = playlists
|
||||||
logger.debug(u'Refreshed %d stored playlist(s)', len(playlists))
|
logger.debug(u'Refreshed %d stored playlist(s)', len(playlists))
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user