Merge pull request #3448 from xhocquet/genius-lowercase-artist-fix

Genius lyrics fix for API capitalization behaviors
This commit is contained in:
Adrian Sampson 2020-02-02 20:46:24 -05:00 committed by GitHub
commit d4d04c61aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -395,13 +395,19 @@ class Genius(Backend):
song_info = None
for hit in json["response"]["hits"]:
if hit["result"]["primary_artist"]["name"] == artist:
# Genius uses zero-width characters to denote lowercase artist names
hit_artist = hit["result"]["primary_artist"]["name"].strip(u'\u200b').lower()
if hit_artist == artist.lower():
song_info = hit
break
if song_info:
self._log.debug(u'fetched: {0}', song_info["result"]["url"])
song_api_path = song_info["result"]["api_path"]
return self.lyrics_from_song_api_path(song_api_path)
else:
self._log.debug(u'genius: no matching artist')
class LyricsWiki(SymbolsReplaced):

View file

@ -151,6 +151,8 @@ Fixes:
* :doc:`/plugins/bpd`: Fix the transition to next track when in consume mode.
Thanks to :user:`aereaux`.
:bug:`3437`
* :doc:`/plugins/lyrics`: Fix a corner-case with Genius lowercase artist names
:bug:`3446`
For plugin developers: