mirror of
https://github.com/SinTan1729/movie-rename.git
synced 2024-12-25 19:58:36 -06:00
fix: Sanitization doesn't squash single hyphens
This commit is contained in:
parent
e9314ccdda
commit
96fcf425b0
1 changed files with 7 additions and 3 deletions
|
@ -49,10 +49,14 @@ impl MovieEntry {
|
|||
} else {
|
||||
format = format.replace("{director}", "");
|
||||
}
|
||||
|
||||
// Try to clean extra spaces and such
|
||||
format = format.trim_matches(|c| "- ".contains(c)).to_string();
|
||||
while format.contains("- -") {
|
||||
format = format.replace("- -", "-");
|
||||
}
|
||||
|
||||
format
|
||||
.trim_matches(|c| "- ".contains(c))
|
||||
.replace("--", "-")
|
||||
.replace("- ", "")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue