audiotags icon indicating copy to clipboard operation
audiotags copied to clipboard

AudioTag::year() not always valid when it should be

Open TurtleP opened this issue 2 years ago • 1 comments

Hi,

I'm new to Rust and started working on a program which iterates through the id3 tags of my iTunes purchased music.

I checked iTunes for the Year tag, which is valid, but the AudioTag value is None. Here's a small example:

use std::path::Path;

let path = Path::new("03 How to Save a Life (New Version).m4a")
let tag = Tag::default().read_from_path(path);

let year = tag.year().unwrap_or(0);
println("Year {}", year)

-- Output
Year: 0

image

I don't have my code up on GitHub yet, although if you need anything further from me, please let me know.

TurtleP avatar Dec 07 '21 16:12 TurtleP

We merged audiotags2 to audiotags with lots of updates so if you use the 0.4 version what result would you get ?

For tag try this:

let mut tag = Tag::new().read_from_path(MP3_FILE).expect("Could not open the file");

pinkforest avatar Jul 31 '22 16:07 pinkforest