From c0c474b20f251855f9678a61d4e377e5d3510b16 Mon Sep 17 00:00:00 2001 From: Fabrice Laporte Date: Wed, 8 Oct 2014 14:49:09 +0200 Subject: [PATCH] lyrics: strip title excerpt before matching improve the extraction of lyrics title from url title and increase the matching threshold as a consequence. --- beetsplug/lyrics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beetsplug/lyrics.py b/beetsplug/lyrics.py index 00954e2c3..e58408f04 100644 --- a/beetsplug/lyrics.py +++ b/beetsplug/lyrics.py @@ -271,8 +271,9 @@ def is_page_candidate(urlLink, urlTitle, title, artist): tokens = [by + '_' + artist for by in BY_TRANS] + \ [artist, sitename, sitename.replace('www.', '')] + LYRICS_TRANS songTitle = re.sub(u'(%s)' % u'|'.join(tokens), u'', urlTitle) + songTitle = songTitle.strip('_|') + typoRatio = .9 - typoRatio = .8 return difflib.SequenceMatcher(None, songTitle, title).ratio() >= typoRatio