coverart fix #34

Merged
phoenix merged 7 commits from coverart_fix into devel 2025-06-25 21:44:05 +00:00
3 changed files with 13 additions and 3 deletions

2
Cargo.lock generated
View File

@@ -81,7 +81,7 @@ dependencies = [
[[package]]
name = "icarus_meta"
version = "0.2.0"
version = "0.2.1"
dependencies = [
"lofty",
"tempfile",

View File

@@ -1,6 +1,6 @@
[package]
name = "icarus_meta"
version = "0.2.0"
version = "0.2.1"
edition = "2024"
rust-version = "1.86"

View File

@@ -21,7 +21,17 @@ pub mod coverart {
match lofty::picture::PictureInformation::from_picture(&pic) {
Ok(info) => {
flac_file.set_picture(0, pic.clone(), info);
Ok(pic.into_data())
match flac_file.save_to_path(
song_filepath,
lofty::config::WriteOptions::default(),
) {
Ok(_) => Ok(pic.into_data()),
Err(err) => Err(std::io::Error::new(
std::io::ErrorKind::InvalidData,
err.to_string(),
)),
}
}
Err(err) => Err(std::io::Error::new(
std::io::ErrorKind::InvalidData,