despotify: search() should always return a Playlist

This commit is contained in:
Stein Magnus Jodal 2010-02-12 22:47:23 +01:00
parent ac13b20667
commit 379694ac4e

View File

@ -38,8 +38,9 @@ class DespotifyLibraryController(BaseLibraryController):
def search(self, type, what): def search(self, type, what):
query = u'%s:%s' % (type, what) query = u'%s:%s' % (type, what)
result = self.backend.spotify.search(query.encode(ENCODING)) result = self.backend.spotify.search(query.encode(ENCODING))
if result is not None: if result is None:
return self.backend.translate.to_mopidy_playlist(result.playlist) return Playlist()
return self.backend.translate.to_mopidy_playlist(result.playlist)
class DespotifyPlaybackController(BasePlaybackController): class DespotifyPlaybackController(BasePlaybackController):