fix: Sanitization doesn't squash single hyphens

This commit is contained in:
Sayantan Santra 2023-05-21 20:44:33 -05:00
parent e9314ccdda
commit 96fcf425b0
Signed by: SinTan1729
GPG Key ID: EB3E68BFBA25C85F
1 changed files with 7 additions and 3 deletions

View File

@ -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("- ", "")
}
}