diff --git a/src/music_storage/library.rs b/src/music_storage/library.rs index 502429b..84fc2e0 100644 --- a/src/music_storage/library.rs +++ b/src/music_storage/library.rs @@ -274,7 +274,7 @@ impl Song { /// creates a `Vec` from a cue file - pub fn from_cue(cuesheet: &Path) -> Result<(Vec<(Self, PathBuf)>), Box> { + pub fn from_cue(cuesheet: &Path) -> Result, Box> { let mut tracks = Vec::new(); let cue_data = parse_from_file(&cuesheet.to_string_lossy(), false).unwrap(); diff --git a/src/music_storage/utils.rs b/src/music_storage/utils.rs index 0d6fb47..f4665a3 100644 --- a/src/music_storage/utils.rs +++ b/src/music_storage/utils.rs @@ -74,12 +74,9 @@ pub fn find_images(song_path: &Path) -> Result, Box> { .follow_links(true) .into_iter() .filter_map(|e| e.ok()) + .filter(|e| e.depth() < 3) // Don't recurse very deep { - if target_file.depth() >= 3 { - // Don't recurse very deep - break; - } - + println!("{:?}", target_file); let path = target_file.path(); if !path.is_file() { continue; @@ -87,7 +84,7 @@ pub fn find_images(song_path: &Path) -> Result, Box> { let format = FileFormat::from_file(path)?.kind(); if format != Kind::Image { - break; + continue; } let image_uri = URI::Local(path.to_path_buf().canonicalize()?);