From 565d361b64f23c2a0100b33fceeebacfad3331c4 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 26 Jun 2025 22:23:25 +0000 Subject: [PATCH] Added function to get all Types (#36) Reviewed-on: https://git.kundeng.us/phoenix/icarus_meta/pulls/36 Co-authored-by: phoenix Co-committed-by: phoenix --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/types.rs | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d6282c8..cc173ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,7 +81,7 @@ dependencies = [ [[package]] name = "icarus_meta" -version = "0.2.1" +version = "0.2.2" dependencies = [ "lofty", "tempfile", diff --git a/Cargo.toml b/Cargo.toml index 5640c4a..9b4d265 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus_meta" -version = "0.2.1" +version = "0.2.2" edition = "2024" rust-version = "1.86" diff --git a/src/types.rs b/src/types.rs index b7efc00..05a30b0 100644 --- a/src/types.rs +++ b/src/types.rs @@ -32,6 +32,21 @@ impl MetadataType { } } +pub fn all_metadata_types() -> Vec { + 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 { match t {