mirror of
https://github.com/Dangoware/dmp-core.git
synced 2025-04-19 13:22:54 -05:00
Fixes album art discovery
This commit is contained in:
parent
96069fd9bc
commit
f7960518ca
2 changed files with 4 additions and 7 deletions
|
@ -274,7 +274,7 @@ impl Song {
|
||||||
|
|
||||||
/// creates a `Vec<Song>` from a cue file
|
/// 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 mut tracks = Vec::new();
|
||||||
|
|
||||||
let cue_data = parse_from_file(&cuesheet.to_string_lossy(), false).unwrap();
|
let cue_data = parse_from_file(&cuesheet.to_string_lossy(), false).unwrap();
|
||||||
|
|
|
@ -74,12 +74,9 @@ pub fn find_images(song_path: &Path) -> Result<Vec<AlbumArt>, Box<dyn Error>> {
|
||||||
.follow_links(true)
|
.follow_links(true)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|e| e.ok())
|
.filter_map(|e| e.ok())
|
||||||
|
.filter(|e| e.depth() < 3) // Don't recurse very deep
|
||||||
{
|
{
|
||||||
if target_file.depth() >= 3 {
|
println!("{:?}", target_file);
|
||||||
// Don't recurse very deep
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
let path = target_file.path();
|
let path = target_file.path();
|
||||||
if !path.is_file() {
|
if !path.is_file() {
|
||||||
continue;
|
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();
|
let format = FileFormat::from_file(path)?.kind();
|
||||||
if format != Kind::Image {
|
if format != Kind::Image {
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let image_uri = URI::Local(path.to_path_buf().canonicalize()?);
|
let image_uri = URI::Local(path.to_path_buf().canonicalize()?);
|
||||||
|
|
Loading…
Reference in a new issue