Fixed bug for unknown year

This commit is contained in:
Sayantan Santra 2022-12-08 01:07:44 -06:00
parent c65b0823fb
commit 7fee309ff3

View file

@ -30,7 +30,9 @@ impl MovieEntry {
// Generate desired filename from movie entry // Generate desired filename from movie entry
fn rename_format(&self, mut format: String) -> String { fn rename_format(&self, mut format: String) -> String {
format = format.replace("{title}", self.title.as_str()); format = format.replace("{title}", self.title.as_str());
if self.year.as_str() != "n/a" {
format = format.replace("{year}", self.year.as_str()); format = format.replace("{year}", self.year.as_str());
}
format = format.replace("{director}", self.director.as_str()); format = format.replace("{director}", self.director.as_str());
format format
} }