use correct file extension when renaming

This commit is contained in:
Paul Campbell 2023-11-12 14:36:51 +00:00
parent de2df1242b
commit 2ee3a89688

View file

@ -33,8 +33,8 @@ fn rename_files(directory: &str, base: &str) -> Result<i32> {
let album = parse_album(&title);
count += 1;
let new_name = match album.len() {
0 => format!("{artist}/{title}.mp4a"),
_ => format!("{artist}/{album}/{title}.mp4b"),
0 => format!("{artist}/{title}.m4b"),
_ => format!("{artist}/{album}/{title}.m4b"),
};
println!("Renaming {} to {}", path.display(), new_name);
let target_path = Path::new(&base).join(new_name);