From ce4e681e7b03629f147e0cd8562e171a0b045a30 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 1 Nov 2011 08:46:43 +0100 Subject: [PATCH] Use new method in playlists to check if they are playlists or folder boundaries --- mopidy/backends/spotify/translator.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mopidy/backends/spotify/translator.py b/mopidy/backends/spotify/translator.py index 95287d77..cc72aecd 100644 --- a/mopidy/backends/spotify/translator.py +++ b/mopidy/backends/spotify/translator.py @@ -51,9 +51,8 @@ class SpotifyTranslator(object): def to_mopidy_playlist(cls, spotify_playlist): if not spotify_playlist.is_loaded(): return Playlist(name=u'[loading...]') - # FIXME Replace this try-except with a check on the playlist type, - # which is currently not supported by pyspotify, to avoid handling - # playlist folder boundaries like normal playlists. + if spotify_playlist.type() != 'playlist': + return try: return Playlist( uri=str(Link.from_playlist(spotify_playlist)), @@ -63,5 +62,4 @@ class SpotifyTranslator(object): if str(Link.from_track(t, 0))], ) except SpotifyError, e: - logger.info(u'Failed translating Spotify playlist ' - '(probably a playlist folder boundary): %s', e) + logger.warning(u'Failed translating Spotify playlist: %s', e)