diff --git a/Cargo.lock b/Cargo.lock index 7fbf564..d6282c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,7 +81,7 @@ dependencies = [ [[package]] name = "icarus_meta" -version = "0.2.0" +version = "0.2.1" dependencies = [ "lofty", "tempfile", diff --git a/Cargo.toml b/Cargo.toml index 239b90a..5640c4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus_meta" -version = "0.2.0" +version = "0.2.1" edition = "2024" rust-version = "1.86" diff --git a/src/meta.rs b/src/meta.rs index f70643e..3deb1a3 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -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,