From a5cb34360d970a83c67ee237efd3c1a246c8723d Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sun, 12 May 2013 12:38:48 -0700 Subject: [PATCH] lyrics: fix encoding for Lyrics.com --- beetsplug/lyrics.py | 3 ++- docs/changelog.rst | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/beetsplug/lyrics.py b/beetsplug/lyrics.py index 03ac7d26a..8b480ce5c 100644 --- a/beetsplug/lyrics.py +++ b/beetsplug/lyrics.py @@ -153,8 +153,9 @@ LYRICSCOM_NOT_FOUND = ( 'Submit Lyrics', ) def _lc_encode(s): + s = re.sub(r'[^\w\s-]', '', s) s = re.sub(r'\s+', '-', s) - return _encode(s) + return _encode(s).lower() def fetch_lyricscom(artist, title): """Fetch lyrics from Lyrics.com.""" diff --git a/docs/changelog.rst b/docs/changelog.rst index a16046940..885c2a7c6 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -19,6 +19,8 @@ Changelog example. Thanks to Lucas Duailibe. * The importer output now shows the number of audio files in each album. Thanks to jayme on GitHub. +* :doc:`/plugins/lyrics`: Lyrics searches should now turn up more results due + to some fixes in dealing with special characters. 1.1.0 (April 29, 203) ---------------------