Zeugma440 / atldotnet

Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
MIT License
459 stars 61 forks source link

YEAR tag shows as DATE in FLAC (and maybe more formats) #190

Closed orbittwz closed 1 year ago

orbittwz commented 1 year ago

The problem

Referring #182 and also commented there about my experience with saving FLAC files with YEAR tag.

Environment

Details

If not setting YEAR tag, i.e changing it, when saving the track, the YEAR tag shows as XXXX-XX-XX (date) and not as XXXX.

Code To Reproduce Issue [ Good To Have ]

I will try to test out saving the year by force and see if that makes a difference.

Zeugma440 commented 1 year ago

Thanks for your feedback. I'd love to have a few more details about that issue.

I understand you're setting the Track.Year field and saving the file, and find the year you've set formatted as 01-01-YYYY when reading the saved FLAC file.

Could you confirm you're actually talking about the DATE field ? The thing is FLAC (Vorbis) tag specifications define no YEAR field.

NB : MP3 (ID3v2) shouldn't have this issue as its specifications allow no such "flexible" date formatting as M4A and Vorbis (see https://wiki.xiph.org/VorbisComment#ISO_proposal for the latter)

orbittwz commented 1 year ago

Details as follows: image above - when NOT writing YEAR tag, just saving track with normal changes, like album and such, the YEAR tag is shown as DATE!

below - when FORCING writing YEAR tag (which is not necessary because was correct, doing it for test), and saving the track, the YEAR tag is shown CORRECTLY! image

why I need to force writing the YEAR tag for it to show correctly? some logs: 2023-03-31 11:10:07.173 +03:00 [INF] trackdata year is 2021 2023-03-31 11:10:07.174 +03:00 [INF] trackdata date is 01/01/2021 00:00:00 Changed year in track 1 to 2023 .

as shown in logs, I'm getting the track data before for year tag and date tag... I'm not using date, but when I'm not forcing writing YEAR tag, it becomes the DATE tag... Let me know if you need further information... Thanks :)

Zeugma440 commented 1 year ago

Thanks for the explanation. Bug confirmed on my side too. I'll post a fix soon.

orbittwz commented 1 year ago

sweet, will tune in later to catch the update and try it out... thank you very much!

Zeugma440 commented 1 year ago

The Vorbis DATE field is supposed to behave like the MP4/M4A ©day field but wasn't implemented nor tested the same way.

Now both are aligned and your issue is gone. The fix is available on today's v4.27

orbittwz commented 1 year ago

confirmed working! much appreciation for the quick replies and fix.