fix: Do not rename directory if only file was skipped

This commit is contained in:
Sayantan Santra 2023-05-21 22:42:30 -05:00
parent 591ae8f796
commit d7172c78f6
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -90,6 +90,11 @@ async fn main() {
if movie_list.len() == 1 {
let entry_clean = entry.trim_end_matches('/');
let movie_name = movie_list.into_values().next().unwrap();
// If the file was ignored, exit
if movie_name.is_empty() {
eprintln!("Not renaming directory as only movie was skipped.");
continue;
}
if entry_clean == movie_name {
println!("[directory] '{entry_clean}' already has correct name.");