From 18108b5d44ae585e06be070ee2b351be9486834d Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sun, 7 Jun 2020 16:30:47 -0700 Subject: [PATCH] Print full path when suggesting moves. --- src/lib.rs | 2 +- src/main.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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")