From 51cfde4e9df86820f3b63215f7af47fb01df9528 Mon Sep 17 00:00:00 2001 From: jmwatte Date: Thu, 9 Apr 2015 18:48:37 +0200 Subject: [PATCH] fix bs1770gain for windows and exceptionally big albums --- beetsplug/replaygain.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/beetsplug/replaygain.py b/beetsplug/replaygain.py index dc25e79fb..0886ddb1d 100644 --- a/beetsplug/replaygain.py +++ b/beetsplug/replaygain.py @@ -208,9 +208,10 @@ class Bs1770gainBackend(Backend): """ out = [] data = text.decode('utf8', errors='ignore') - regex = re.compile(ur'(\s{2,2}\[\d+\/\d+\].*?|\[ALBUM\].*?)' - '(?=\s{2,2}\[\d+\/\d+\]|\s{2,2}\[ALBUM\]:|done\.\s)' - ', re.DOTALL | re.UNICODE') + regex = re.compile( + ur'(\s{2,2}\[\d+\/\d+\].*?|\[ALBUM\].*?\ + )(?=\s{2,2}\[\d+\/\d+\]|\s{2,2}\[ALBUM\]:|done\.\s\ + )', re.DOTALL | re.UNICODE) results = re.findall(regex, data) for parts in results[0:num_lines]: part = parts.split(b'\n')