spotify: Support search by track URI (fixes #233)
This commit is contained in:
parent
7ec156e373
commit
0dd09bce82
@ -102,6 +102,9 @@ backends:
|
||||
- The MPD commands ``search`` and ``find`` now allows the key ``file``, which
|
||||
is used by ncmpcpp instead of ``filename``.
|
||||
|
||||
- The Spotify backend now returns the track if you search for the Spotify track
|
||||
URI. (Fixes: :issue:`233`)
|
||||
|
||||
**Bug fixes**
|
||||
|
||||
- :issue:`218`: The MPD commands ``listplaylist`` and ``listplaylistinfo`` now
|
||||
|
||||
@ -75,9 +75,16 @@ class SpotifyLibraryProvider(base.BaseLibraryProvider):
|
||||
return Playlist(tracks=tracks)
|
||||
spotify_query = []
|
||||
for (field, values) in query.iteritems():
|
||||
if field == 'track':
|
||||
if field == 'uri':
|
||||
tracks = []
|
||||
for value in values:
|
||||
track = self.lookup(value)
|
||||
if track:
|
||||
tracks.append(track)
|
||||
return Playlist(tracks=tracks)
|
||||
elif field == 'track':
|
||||
field = 'title'
|
||||
if field == 'date':
|
||||
elif field == 'date':
|
||||
field = 'year'
|
||||
if not hasattr(values, '__iter__'):
|
||||
values = [values]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user