Print full path when suggesting moves.

This commit is contained in:
Bill Thiede 2020-06-07 16:30:47 -07:00
parent 8af62e313b
commit 18108b5d44
2 changed files with 7 additions and 2 deletions

View File

@ -280,7 +280,7 @@ pub struct MetadataFile {
#[derive(PartialEq, Debug)] #[derive(PartialEq, Debug)]
pub struct MovieLibrary { pub struct MovieLibrary {
root: String, pub root: String,
} }
fn json_metadata_for_path<P: AsRef<Path> + AsRef<OsStr>>(path: P) -> Result<String, Error> { fn json_metadata_for_path<P: AsRef<Path> + AsRef<OsStr>>(path: P) -> Result<String, Error> {

View File

@ -1,6 +1,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::error::Error; use std::error::Error;
use std::io::Write; use std::io::Write;
use std::path::Path;
use std::time::Duration; use std::time::Duration;
use human_format::Formatter; use human_format::Formatter;
@ -68,8 +69,12 @@ fn print_dupes(lib: &MovieLibrary) {
println!(); println!();
} }
delete_paths.sort(); delete_paths.sort();
let root = Path::new(&lib.root);
for path in &delete_paths { 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 { if delete_paths.len() > 0 {
println!("superdeduper update-compact-metadata && superdeduper empty-dirs") println!("superdeduper update-compact-metadata && superdeduper empty-dirs")