fix: Still ask for language for preprocessed files

This commit is contained in:
Sayantan Santra 2023-05-21 20:50:16 -05:00
parent 96fcf425b0
commit c7c1988b73
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -62,6 +62,10 @@ pub async fn process_file(
// Check if it should be ignored // Check if it should be ignored
if preprocessed && new_name_base.is_empty() { if preprocessed && new_name_base.is_empty() {
eprintln!(
" Ignoring {} as per previous choice for related files...",
file_base
);
return (filename_without_ext, "".to_string(), false); return (filename_without_ext, "".to_string(), false);
} }
@ -140,6 +144,12 @@ pub async fn process_file(
} }
}; };
// Create the new name
new_name_base = choice.rename_format(pattern.to_string());
} else {
println!(" Using previous choice for related files...");
}
// Handle the case for subtitle files // Handle the case for subtitle files
if ["srt", "ssa"].contains(&extension.as_str()) { if ["srt", "ssa"].contains(&extension.as_str()) {
// Try to detect if there's already language info in the filename, else ask user to choose // Try to detect if there's already language info in the filename, else ask user to choose
@ -161,10 +171,6 @@ pub async fn process_file(
} }
} }
// Create the new name
new_name_base = choice.rename_format(pattern.to_string());
}
// Add extension and stuff to the new name // Add extension and stuff to the new name
let mut new_name_with_ext = new_name_base.clone(); let mut new_name_with_ext = new_name_base.clone();
if !extension.is_empty() { if !extension.is_empty() {