added search to spotify backend to satisfy sonata
This commit is contained in:
parent
148d3c55a2
commit
c9ba7341fc
@ -78,3 +78,7 @@ class BaseBackend(object):
|
||||
# Stored playlist methods
|
||||
def playlists_list(self):
|
||||
return None
|
||||
|
||||
# Music database methods
|
||||
def search(self, type, what):
|
||||
return None
|
||||
|
||||
@ -195,3 +195,8 @@ class SpotifyBackend(BaseBackend):
|
||||
|
||||
def url_handlers(self):
|
||||
return [u'spotify:', u'http://open.spotify.com/']
|
||||
|
||||
# Music database methods
|
||||
def search(self, type, what):
|
||||
result = self.spotify.search(encode(u'%s:%s' % (type, what)))
|
||||
return self._format_playlist(result.playlist.tracks)
|
||||
|
||||
@ -323,7 +323,7 @@ class MpdHandler(object):
|
||||
|
||||
@register(r'^search "(?P<type>(album|artist|filename|title))" "(?P<what>.+)"$')
|
||||
def _search(self, type, what):
|
||||
pass # TODO
|
||||
return self.backend.search(type, what)
|
||||
|
||||
@register(r'^seek (?P<songpos>.+) (?P<seconds>\d+)$')
|
||||
def _seek(self, songpos, seconds):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user