mirror of
https://github.com/SinTan1729/movie-rename.git
synced 2024-12-26 12:18:37 -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 {
|
} else {
|
||||||
format = format.replace("{director}", "");
|
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
|
format
|
||||||
.trim_matches(|c| "- ".contains(c))
|
|
||||||
.replace("--", "-")
|
|
||||||
.replace("- ", "")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue