despotify: search() should always return a Playlist
This commit is contained in:
parent
ac13b20667
commit
379694ac4e
@ -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):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user