Skip to content

Commit

Permalink
Fallback to Illustation/Icon/OtherIcon when cover is not found
Browse files Browse the repository at this point in the history
Fix #826
  • Loading branch information
martpie committed Feb 17, 2025
1 parent 685a90a commit c3fd6d2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src-tauri/src/plugins/cover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ fn get_cover_from_id3(path: String) -> Option<String> {
None => return None,
};

let cover = match primary_tag.get_picture_type(PictureType::CoverFront) {
Some(cover) => cover,
None => return None,
};
let cover = primary_tag
.get_picture_type(PictureType::CoverFront)
.or_else(|| primary_tag.get_picture_type(PictureType::Illustration))
.or_else(|| primary_tag.get_picture_type(PictureType::Icon))
.or_else(|| primary_tag.get_picture_type(PictureType::OtherIcon))?;

let format = match cover.mime_type() {
Some(MimeType::Png) => "png".to_string(),
Expand Down

0 comments on commit c3fd6d2

Please sign in to comment.