From b407ab140c0f34be6c0e1bdbe16c8b14041e7e0e Mon Sep 17 00:00:00 2001 From: Colin Diesh Date: Wed, 31 Aug 2022 22:26:06 -0600 Subject: [PATCH] Add example of reading album artist to tag reader (#65) --- examples/tag_reader.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tag_reader.rs b/examples/tag_reader.rs index 042a554e..d05860b0 100644 --- a/examples/tag_reader.rs +++ b/examples/tag_reader.rs @@ -28,6 +28,13 @@ fn main() { println!("Album: {}", tag.album().unwrap_or("None")); println!("Genre: {}", tag.genre().unwrap_or("None")); + // import keys from https://docs.rs/lofty/latest/lofty/enum.ItemKey.html + println!( + "Album Artist: {}", + tag.get_string(&lofty::ItemKey::AlbumArtist) + .unwrap_or("None") + ); + let properties = tagged_file.properties(); let duration = properties.duration();