diff --git a/src/lib.rs b/src/lib.rs index 4225a63..bb9b186 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -329,17 +329,6 @@ impl Movie { })) } } - - fn min_resolution(&self) -> Option { - if self.files.is_empty() { - None - } else { - Some(self.files.iter().fold( - Resolution(usize::max_value(), usize::max_value()), - |acc, (_, cmd)| std::cmp::min(acc, cmd.largest_dimension().unwrap()), - )) - } - } } impl Display for Movie { @@ -671,7 +660,7 @@ impl MovieLibrary { Ok(movies_from_paths_compact_metadata(p_cmd)) } - pub fn videos(&self) -> Result<(HashMap), Error> { + pub fn videos(&self) -> Result, Error> { let path = Path::new(&self.root).join(COMPACT_METADATA_FILENAME); let f = File::open(&path).context(format!("open {}", path.display()))?; let r = BufReader::new(f); diff --git a/src/main.rs b/src/main.rs index 3aa176b..4e8cf3e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -261,10 +261,11 @@ fn main() -> Result<(), Box> { Command::EmptyDirs => { let lib = MovieLibrary::new(MOVIE_DIR); let dirs = lib.empty_dirs()?; + let root = Path::new(&lib.root); if !dirs.is_empty() { println!("Empty directories:"); for d in dirs { - println!(" {}", d); + println!(r#"rm -rf "{}""#, root.join(d).to_string_lossy()); } } }