Compare commits

..

3 Commits

Author SHA1 Message Date
565d361b64 Added function to get all Types (#36)
All checks were successful
Release Tagging / release (push) Successful in 33s
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 29s
Rust Build / Rustfmt (push) Successful in 27s
Rust Build / Clippy (push) Successful in 29s
Rust Build / build (push) Successful in 34s
Rust Build / Check (pull_request) Successful in 36s
Rust Build / Test Suite (pull_request) Successful in 41s
Rust Build / Rustfmt (pull_request) Successful in 28s
Rust Build / Clippy (pull_request) Successful in 38s
Rust Build / build (pull_request) Successful in 32s
Reviewed-on: #36
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-26 22:23:25 +00:00
973d163ca5 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>
2025-06-25 21:44:04 +00:00
9c7eefe7af Version bump (#32)
All checks were successful
Rust Build / Check (push) Successful in 25s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Clippy (push) Successful in 26s
Rust Build / build (push) Successful in 32s
Release Tagging / release (push) Successful in 31s
Rust Build / Check (pull_request) Successful in 30s
Rust Build / Test Suite (pull_request) Successful in 29s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 26s
Rust Build / build (pull_request) Successful in 32s
Reviewed-on: #32
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-24 23:46:51 +00:00
5 changed files with 30 additions and 3 deletions

2
Cargo.lock generated
View File

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

View File

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

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
Library to manage metadata of flac files, used in various icarus-related software
projects.

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,

View File

@@ -32,6 +32,21 @@ impl MetadataType {
}
}
pub fn all_metadata_types() -> Vec<Type> {
vec![
Type::Album,
Type::Artist,
Type::AlbumArtist,
Type::Date,
Type::Disc,
Type::Genre,
Type::Title,
Type::Track,
Type::TrackCount,
Type::DiscCount,
]
}
pub mod access {
pub fn get_type(t: super::Type) -> Result<String, std::io::Error> {
match t {