mirror of
https://github.com/SinTan1729/movie-rename.git
synced 2024-12-26 12:18:37 -06:00
change: More consistency improvements
This commit is contained in:
parent
9456009b4d
commit
779064034a
2 changed files with 6 additions and 6 deletions
|
@ -32,8 +32,8 @@ pub async fn process_file(
|
||||||
let mut parent = String::new();
|
let mut parent = String::new();
|
||||||
if let Some(parts) = filename.rsplit_once('/') {
|
if let Some(parts) = filename.rsplit_once('/') {
|
||||||
{
|
{
|
||||||
parent = parts.0.to_string();
|
parent = String::from(parts.0);
|
||||||
file_base = parts.1.to_string();
|
file_base = String::from(parts.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ impl MovieEntry {
|
||||||
director: String::from("N/A"),
|
director: String::from("N/A"),
|
||||||
year: match movie.inner.release_date {
|
year: match movie.inner.release_date {
|
||||||
Some(date) => date.format("%Y").to_string(),
|
Some(date) => date.format("%Y").to_string(),
|
||||||
_ => "N/A".to_string(),
|
_ => String::from("N/A"),
|
||||||
},
|
},
|
||||||
language: get_long_lang(movie.inner.original_language.as_str()),
|
language: get_long_lang(movie.inner.original_language.as_str()),
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ impl MovieEntry {
|
||||||
title.truncate(159);
|
title.truncate(159);
|
||||||
format = format.replace("{title}", title.as_str());
|
format = format.replace("{title}", title.as_str());
|
||||||
|
|
||||||
if self.year.as_str() != "N/A" {
|
if self.year != "N/A" {
|
||||||
format = format.replace("{year}", self.year.as_str());
|
format = format.replace("{year}", self.year.as_str());
|
||||||
} else {
|
} else {
|
||||||
format = format.replace("{year}", "");
|
format = format.replace("{year}", "");
|
||||||
|
@ -88,7 +88,7 @@ impl Language {
|
||||||
let mut list = Vec::new();
|
let mut list = Vec::new();
|
||||||
for lang in ["en", "hi", "bn", "fr", "ja", "de", "sp", "none"] {
|
for lang in ["en", "hi", "bn", "fr", "ja", "de", "sp", "none"] {
|
||||||
list.push(Language {
|
list.push(Language {
|
||||||
short: lang.to_string(),
|
short: String::from(lang),
|
||||||
long: get_long_lang(lang),
|
long: get_long_lang(lang),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -116,5 +116,5 @@ pub fn get_long_lang(short: &str) -> String {
|
||||||
"none" => "None",
|
"none" => "None",
|
||||||
other => other,
|
other => other,
|
||||||
};
|
};
|
||||||
long.to_string()
|
String::from(long)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue