Skip to content

Commit

Permalink
convert W/ to feat
Browse files Browse the repository at this point in the history
  • Loading branch information
Esgrove committed Jan 30, 2024
1 parent 9d57e85 commit 4906bd8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions rename/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def __init__(self):
(r"\.{2,}", "."),
(r"\(\s*?\)", ""),
(r"(\S)\(", r"\1 ("),
(r"(?i)\sW/", " feat. "),
)
self.filename_regex_substitutes = (
('"', "''"),
Expand Down
1 change: 1 addition & 0 deletions src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ impl TrackFormatter {
"Missy Elliott",
),
(Regex::new(r"(?i)\bGangstarr\b|\bGangstarr$").unwrap(), "Gang Starr"),
(Regex::new(r"(?i)\sW/").unwrap(), " feat. "),
],
filename_regex_substitutes: vec![
(Regex::new("\"").unwrap(), "''"),
Expand Down
6 changes: 6 additions & 0 deletions src/test_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ mod tests {
title: "Dance (A$$) - Tall Boys Remix (DJcity Intro - Dirty)",
correct_title: "Dance (A$$) (Tall Boys Remix) (Dirty Intro)",
},
FormattingTestData {
artist: "Big Sean W/Taku",
correct_artist: "Big Sean feat. Taku",
title: "Dance (A$$)",
correct_title: "Dance (A$$)",
},
];

static NESTED_PARENTHESES_TEST_DATA: &[FormattingTestData] = &[
Expand Down
6 changes: 6 additions & 0 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@
"Lift Me Up (Trayze Drop Leaf Edit) (89 11b)",
"Lift Me Up (Trayze Drop Leaf Edit)",
),
(
"Big Sean W/Taku",
"Big Sean feat. Taku",
"Dance (A$$)",
"Dance (A$$)",
),
]

PARENTHESES_TEST_DATA = [
Expand Down

0 comments on commit 4906bd8

Please sign in to comment.