Compare commits
3 Commits
v0.1.30-de
...
v0.2.2-dev
Author | SHA1 | Date | |
---|---|---|---|
565d361b64 | |||
973d163ca5 | |||
9c7eefe7af |
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -81,7 +81,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "icarus_meta"
|
name = "icarus_meta"
|
||||||
version = "0.1.30"
|
version = "0.2.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lofty",
|
"lofty",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "icarus_meta"
|
name = "icarus_meta"
|
||||||
version = "0.1.30"
|
version = "0.2.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.86"
|
rust-version = "1.86"
|
||||||
|
|
||||||
|
2
README.md
Normal file
2
README.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Library to manage metadata of flac files, used in various icarus-related software
|
||||||
|
projects.
|
12
src/meta.rs
12
src/meta.rs
@@ -21,7 +21,17 @@ pub mod coverart {
|
|||||||
match lofty::picture::PictureInformation::from_picture(&pic) {
|
match lofty::picture::PictureInformation::from_picture(&pic) {
|
||||||
Ok(info) => {
|
Ok(info) => {
|
||||||
flac_file.set_picture(0, pic.clone(), 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(
|
Err(err) => Err(std::io::Error::new(
|
||||||
std::io::ErrorKind::InvalidData,
|
std::io::ErrorKind::InvalidData,
|
||||||
|
15
src/types.rs
15
src/types.rs
@@ -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 mod access {
|
||||||
pub fn get_type(t: super::Type) -> Result<String, std::io::Error> {
|
pub fn get_type(t: super::Type) -> Result<String, std::io::Error> {
|
||||||
match t {
|
match t {
|
||||||
|
Reference in New Issue
Block a user