despotify: Ignore local files in playlists
Fixes initial hang on "Caching stored playlists".
This commit is contained in:
parent
597ea290ae
commit
3cf285f44e
@ -24,6 +24,8 @@ This change log is used to track all major changes to Mopidy.
|
||||
|
||||
- Made :class:`mopidy.mixers.alsa.AlsaMixer` work on machines without a mixer
|
||||
named "Master".
|
||||
- Make :class:`mopidy.backends.DespotifyBackend` ignore local files in
|
||||
playlists (feature added in Spotify 0.4.3). Reported by Richard Haugen Olsen.
|
||||
|
||||
|
||||
0.1.0a0 (2010-03-27)
|
||||
|
||||
@ -137,6 +137,8 @@ class DespotifyTranslator(object):
|
||||
|
||||
@classmethod
|
||||
def to_mopidy_track(cls, spotify_track):
|
||||
if not spotify_track.has_meta_data():
|
||||
return None
|
||||
if dt.MINYEAR <= int(spotify_track.year) <= dt.MAXYEAR:
|
||||
date = dt.date(spotify_track.year, 1, 1)
|
||||
else:
|
||||
@ -158,7 +160,7 @@ class DespotifyTranslator(object):
|
||||
return Playlist(
|
||||
uri=spotify_playlist.get_uri(),
|
||||
name=spotify_playlist.name.decode(ENCODING),
|
||||
tracks=[cls.to_mopidy_track(t) for t in spotify_playlist.tracks],
|
||||
tracks=filter(None, [cls.to_mopidy_track(t) for t in spotify_playlist.tracks]),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user