diff --git a/morituri/common/path.py b/morituri/common/path.py index 8612e92..cb595ae 100644 --- a/morituri/common/path.py +++ b/morituri/common/path.py @@ -45,8 +45,9 @@ class PathFilter(object): path = re.sub(r'[/\\]', '-', path, re.UNICODE) def separators(path): - # replace separators with a hyphen - path = re.sub(r'[:\|]', '-', path, re.UNICODE) + # replace separators with a space-hyphen or hyphen + path = re.sub(r'[:]', ' -', path, re.UNICODE) + path = re.sub(r'[\|]', '-', path, re.UNICODE) return path # change all fancy single/double quotes to normal quotes diff --git a/morituri/test/test_common_path.py b/morituri/test/test_common_path.py index 7cec838..84a66d3 100644 --- a/morituri/test/test_common_path.py +++ b/morituri/test/test_common_path.py @@ -17,9 +17,14 @@ class FilterTestCase(common.TestCase): def testFat(self): part = u'A Word: F**k you?' - self.assertEquals(self._filter.filter(part), u'A Word- F__k you_') + self.assertEquals(self._filter.filter(part), u'A Word - F__k you_') def testSpecial(self): part = u'<<< $&*!\' "()`{}[]spaceship>>>' self.assertEquals(self._filter.filter(part), u'___ _____ ________spaceship___') + + def testGreatest(self): + part = u'Greatest Ever! Soul: The Definitive Collection' + self.assertEquals(self._filter.filter(part), + u'Greatest Ever_ Soul - The Definitive Collection')