mirror of
https://github.com/SinTan1729/movie-rename.git
synced 2024-12-25 11:48:37 -06:00
fix: Do not rename directory if only file was skipped
This commit is contained in:
parent
591ae8f796
commit
d7172c78f6
1 changed files with 5 additions and 0 deletions
|
@ -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.");
|
||||
|
|
Loading…
Reference in a new issue