Fixes album art discovery

This commit is contained in:
G2-Games 2024-03-23 16:07:35 -05:00
parent 96069fd9bc
commit f7960518ca
2 changed files with 4 additions and 7 deletions

View file

@ -274,7 +274,7 @@ impl Song {
/// creates a `Vec<Song>` from a cue file
pub fn from_cue(cuesheet: &Path) -> Result<(Vec<(Self, PathBuf)>), Box<dyn Error>> {
pub fn from_cue(cuesheet: &Path) -> Result<Vec<(Self, PathBuf)>, Box<dyn Error>> {
let mut tracks = Vec::new();
let cue_data = parse_from_file(&cuesheet.to_string_lossy(), false).unwrap();

View file

@ -74,12 +74,9 @@ pub fn find_images(song_path: &Path) -> Result<Vec<AlbumArt>, Box<dyn Error>> {
.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<Vec<AlbumArt>, Box<dyn Error>> {
let format = FileFormat::from_file(path)?.kind();
if format != Kind::Image {
break;
continue;
}
let image_uri = URI::Local(path.to_path_buf().canonicalize()?);