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

View file

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