coverart fix (#34)
All checks were successful
Release Tagging / release (push) Successful in 29s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Rustfmt (push) Successful in 29s
Rust Build / Clippy (push) Successful in 28s
Rust Build / Test Suite (pull_request) Successful in 31s
Rust Build / Rustfmt (pull_request) Successful in 29s
Rust Build / Clippy (pull_request) Successful in 29s
Rust Build / Check (push) Successful in 27s
Rust Build / Test Suite (push) Successful in 29s
Rust Build / build (push) Successful in 35s
Rust Build / build (pull_request) Successful in 33s

Reviewed-on: #34
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
2025-06-25 21:44:04 +00:00
committed by phoenix
parent 9c7eefe7af
commit 973d163ca5
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,