Compare commits
6 Commits
v0.1.30-de
...
v0.3.0-dev
Author | SHA1 | Date | |
---|---|---|---|
f4b71de969 | |||
5288b5de30 | |||
f51b3a0c4e | |||
565d361b64 | |||
973d163ca5 | |||
9c7eefe7af |
@@ -17,7 +17,7 @@ jobs:
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.86.0
|
||||
toolchain: 1.88.0
|
||||
components: cargo
|
||||
|
||||
- name: Extract Version from Cargo.toml
|
||||
|
@@ -18,7 +18,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.86.0
|
||||
toolchain: 1.88.0
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitlab_deploy_key
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.86.0
|
||||
toolchain: 1.88.0
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitlab_deploy_key
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.86.0
|
||||
toolchain: 1.88.0
|
||||
- run: rustup component add rustfmt
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
@@ -73,7 +73,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.86.0
|
||||
toolchain: 1.88.0
|
||||
- run: rustup component add clippy
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
@@ -92,7 +92,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.86.0
|
||||
toolchain: 1.88.0
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitlab_deploy_key
|
||||
|
6
Cargo.lock
generated
6
Cargo.lock
generated
@@ -81,7 +81,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "icarus_meta"
|
||||
version = "0.1.30"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"lofty",
|
||||
"tempfile",
|
||||
@@ -211,9 +211,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tempfile"
|
||||
version = "3.19.1"
|
||||
version = "3.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf"
|
||||
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom",
|
||||
|
@@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "icarus_meta"
|
||||
version = "0.1.30"
|
||||
version = "0.3.0"
|
||||
edition = "2024"
|
||||
rust-version = "1.86"
|
||||
rust-version = "1.88"
|
||||
|
||||
[dependencies]
|
||||
lofty = { version = "0.22.3" }
|
||||
lofty = { version = "0.22.4" }
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = { version = "3.19.1" }
|
||||
tempfile = { version = "3.20.0" }
|
||||
|
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) {
|
||||
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,
|
||||
|
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 fn get_type(t: super::Type) -> Result<String, std::io::Error> {
|
||||
match t {
|
||||
|
Reference in New Issue
Block a user