Use new method in playlists to check if they are playlists or folder boundaries

This commit is contained in:
Stein Magnus Jodal 2011-11-01 08:46:43 +01:00
parent 98756d837e
commit ce4e681e7b

View File

@ -51,9 +51,8 @@ class SpotifyTranslator(object):
def to_mopidy_playlist(cls, spotify_playlist): def to_mopidy_playlist(cls, spotify_playlist):
if not spotify_playlist.is_loaded(): if not spotify_playlist.is_loaded():
return Playlist(name=u'[loading...]') return Playlist(name=u'[loading...]')
# FIXME Replace this try-except with a check on the playlist type, if spotify_playlist.type() != 'playlist':
# which is currently not supported by pyspotify, to avoid handling return
# playlist folder boundaries like normal playlists.
try: try:
return Playlist( return Playlist(
uri=str(Link.from_playlist(spotify_playlist)), uri=str(Link.from_playlist(spotify_playlist)),
@ -63,5 +62,4 @@ class SpotifyTranslator(object):
if str(Link.from_track(t, 0))], if str(Link.from_track(t, 0))],
) )
except SpotifyError, e: except SpotifyError, e:
logger.info(u'Failed translating Spotify playlist ' logger.warning(u'Failed translating Spotify playlist: %s', e)
'(probably a playlist folder boundary): %s', e)