diff --git a/src/lib.rs b/src/lib.rs index 70fe8de..4225a63 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -280,7 +280,7 @@ pub struct MetadataFile { #[derive(PartialEq, Debug)] pub struct MovieLibrary { - root: String, + pub root: String, } fn json_metadata_for_path + AsRef>(path: P) -> Result { diff --git a/src/main.rs b/src/main.rs index 2827863..3aa176b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ use std::collections::HashMap; use std::error::Error; use std::io::Write; +use std::path::Path; use std::time::Duration; use human_format::Formatter; @@ -68,8 +69,12 @@ fn print_dupes(lib: &MovieLibrary) { println!(); } delete_paths.sort(); + let root = Path::new(&lib.root); for path in &delete_paths { - println!(r#"mv "{}" /storage/media/to-be-deleted/"#, path); + println!( + r#"mv "{}" /storage/media/to-be-deleted/"#, + root.join(path).to_string_lossy() + ); } if delete_paths.len() > 0 { println!("superdeduper update-compact-metadata && superdeduper empty-dirs")