From 0bf10f0d05b12ce26b7aec12299ce5e0e01bb7b1 Mon Sep 17 00:00:00 2001 From: Remy Date: Wed, 24 Aug 2011 06:13:47 +0800 Subject: [PATCH] Removed empty tokens --- headphones/searcher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/headphones/searcher.py b/headphones/searcher.py index 90e5b044..84979a0e 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -448,6 +448,8 @@ def verifyresult(title, artistterm, term): #another attempt to weed out substrings. We don't want "Vol III" when we were looking for "Vol II" tokens = re.split('\W', term, re.IGNORECASE | re.UNICODE) for token in tokens: + if not token: + continue if token == 'Various' or token == 'Artists' or token == 'VA': continue if not re.search('(?:\W|^)+' + token + '(?:\W|$)+', title, re.IGNORECASE | re.UNICODE):