From c46ae525fc4f074342436838d227be2c3e44f886 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sat, 23 Jul 2022 21:06:22 -0700 Subject: [PATCH] Just remove dupes, don't move them. --- src/main.rs | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0aa914f..7e7a010 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,6 @@ -use std::collections::HashMap; -use std::error::Error; -use std::io::Write; -use std::path::Path; -use std::time::Duration; +use std::{collections::HashMap, error::Error, io::Write, path::Path, time::Duration}; -use human_format::Formatter; -use human_format::Scales; +use human_format::{Formatter, Scales}; use humantime; use lazy_static::lazy_static; use log::info; @@ -13,9 +8,7 @@ use regex::Regex; use structopt::StructOpt; use tabwriter::TabWriter; -use superdeduper::clean_path_parent; -use superdeduper::CompactMetadata; -use superdeduper::MovieLibrary; +use superdeduper::{clean_path_parent, CompactMetadata, MovieLibrary}; const MOVIE_DIR: &str = "/home/wathiede/Movies"; const TO_BE_REMOVED_DIR: &str = "/home/wathiede/to-be-deleted/"; @@ -71,11 +64,7 @@ fn print_dupes(lib: &MovieLibrary) { delete_paths.sort(); let root = Path::new(&lib.root); for path in &delete_paths { - println!( - r#"mv "{}" {}"#, - root.join(path).to_string_lossy(), - TO_BE_REMOVED_DIR - ); + println!(r#"rm "{}""#, root.join(path).to_string_lossy(),); } if delete_paths.len() > 0 { println!("superdeduper update-compact-metadata && superdeduper empty-dirs") @@ -154,7 +143,7 @@ fn print_videos(videos: &HashMap, filter: Option<&Regex humantime::Duration::from(Duration::from_secs(md.duration as u64)), &name[MOVIE_DIR.len() + 1..] ); - println!("mv '{}' '{}'", name, TO_BE_REMOVED_DIR); + println!("rm '{}'", name); } }