Open klausenbusk opened 5 years ago
Hi @klausenbusk,
I just had a quick debugging session an saw that the file has the record date set but not the year.
Following test code shows what I mean:
byte[] buffer = TestHelper.loadFile("src/test/resources/Moped_Genius_-_Fall_In_Love.mp3");
ID3v24Tag id3v24tag = (ID3v24Tag) ID3v2TagFactory.createTag(buffer);
assertEquals("2015", id3v24tag.getRecordingTime());
I just had a quick debugging session an saw that the file has the record date set but not the year.
Oh.
According to id3info
TYER
is set. Should ID3v2
override the getYear
method and call getRecordingTime
on ID3v2{2...4}Tag
? ID3v2{2..3}
does not contain a getRecordingTime
method at the moment, but it can be added.
According to
id3info
TYER
is set. ShouldID3v2
override thegetYear
method and callgetRecordingTime
onID3v2{2...4}Tag
?ID3v2{2..3}' does not contain a
getRecordingTime` method at the moment, but it can be added.
So getYear
should return recording year.
What do you think? I'm willing to open a PR if it sounds good to you?
I just had a quick debugging session an saw that the file has the record date set but not the year.
Oh. According to
id3info
TYER
is set.
If I remember correctly TYER was probed but it was not set. A look with a hex code editor comes to the same result.
Question is if getYear() should fall back to TDRC if TYE and TYER are not set but I tend to not doing so as it is a different field. This could be handled by the application itself, if desired.
Everyone ok with this? @mpatric @tmzkt
I don't like the fact that ID3v24Tag allows users to get/set TYER and TDAT - those are not valid ID3 v2.4 frames. They should be using TDRC. There are two ways I can think to solve this:
getYear
, setYear
, getDate
, and setDate
from ID3v24Tag
and force users to use getRecordingTime
and setRecordingTime
getYear
, setYear
, getDate
, and setDate
in ID3v24Tag
to manipulate TDRC (and never TYER and TDAT)It is probably best to go with option 2 so that the interface remains consistent between ID3v22Tag
, ID3v23Tag
, and ID3v24Tag
.
Hi
I'm using mp3agic as part of my Java music player project, it works well, but
getYear
always returnsnull
with my test data.So I tried reading the year with the mp3agic exampe to rule out any programmatic errors from my side. Running the example I get:
As you can see, getYear returns null. I also tried reading the id3 tags with another library (easytag which use id3lib), and it works perfectly (I get year 2015).
Test data:
MopedGenius-_Fall_In_Love.zip Downloaded from: https://www.jamendo.com/track/1562762/fall-in-love (License)
- Kristian