Skip to content

Commit

Permalink
Handle more exceptions in title tag normalization code - 79
Browse files Browse the repository at this point in the history
  • Loading branch information
desbma committed Aug 27, 2019
1 parent b5f5793 commit fbddeef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions amg/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def __init__(self, artist, album):
suffixes=(" productions",)))

# detect and remove track number prefix
self.registerCleaner(RegexPrefixCleaner("^[0-9]+ - ",
contains=(" - ",)))
self.registerCleaner(RegexPrefixCleaner("^[0-9]+[ -.]+ ",
contains=(" - ", ". ")))

# detect and remove 'xxx records' suffix
self.registerCleaner(RecordsSuffixCleaner("recordings"))
Expand Down
6 changes: 6 additions & 0 deletions tests/normalize_title_tag.json
Original file line number Diff line number Diff line change
Expand Up @@ -688,5 +688,11 @@
"artist": "Nameless Void",
"album": "Nameless Void",
"result": "Where Stars Forever Die"
},
{
"source": "4. Dead Feathers - Horse And Sands",
"artist": "Dead Feathers",
"album": "All Is Lost",
"result": "Horse and Sands"
}
]

0 comments on commit fbddeef

Please sign in to comment.