diff --git a/headphones/helpers.py b/headphones/helpers.py index 29f23aeb..12642833 100644 --- a/headphones/helpers.py +++ b/headphones/helpers.py @@ -294,6 +294,8 @@ def expand_subfolders(f): def extract_data(s): + s = s.replace('_', ' ') + #headphones default format pattern = re.compile(r'(?P.*?)\s\-\s(?P.*?)\s\[(?P.*?)\]', re.VERBOSE) match = pattern.match(s) @@ -314,8 +316,8 @@ def extract_data(s): return (name, album, year) #Gonna take a guess on this one - might be enough to search on mb - # TODO: add in a bunch of re pattern matches - pat = re.compile(r"\s*(?P[^:]+)\s*-(?P.*?)\s*$") + pat = re.compile(r"(?P.*?)\s*-\s*(?P[^\[(-]*)") + match = pat.match(s) if match: name = match.group("name")