fix: Do not print both processing and ignoring

This commit is contained in:
Sayantan Santra 2023-05-20 17:03:18 -05:00
parent 8a84f1b2b6
commit 7cb18202eb
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -34,14 +34,15 @@ pub async fn process_file(
file_base = parts.1.to_string();
}
}
println!(" Processing {}...", file_base);
// Parse the filename for metadata
let metadata = Metadata::from(file_base.as_str()).expect(" Could not parse filename!");
// Process only if it's a valid file format
let mut extension = metadata.extension().unwrap_or("").to_string();
if !["mp4", "avi", "mkv", "flv", "m4a", "srt", "ssa"].contains(&extension.as_str()) {
if ["mp4", "avi", "mkv", "flv", "m4a", "srt", "ssa"].contains(&extension.as_str()) {
println!(" Processing {}...", file_base);
} else {
println!(" Ignoring {}...", file_base);
return ("n/a".to_string(), false);
}