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

ATL.Track.Year writes full date #182

Closed audiamus closed 1 year ago

audiamus commented 1 year ago

The problem

ATL.Track.Year is defined as int? but appears to write full date to tags, e.g. not "2015" but "2015-01-01" (.mp4 and .mp3)

Environment

Details

It's been a while, or more precisely 19 months, between the last two releases of AAX Audio Converter. The earlier one 1.17.1 used ATL 4.4 (with over 90,000 downloads) and the latest version 1.18 is built against ATL 4.17.

An AAX Audio Converter user now reported an issue with 1.18, regarding the publication year of an audiobook. I use ATL.Track.Year for this, because ATL.Track.PublishingDate would be full date but we don't have month or day.

ATL.Track.Year tag shows as "Recorded date" and used to be year-only but now comes with -01-01

It would be nice if ATL reverts to the original year-only tag.

Code To Reproduce Issue [ Good To Have ]

(Always)

Side note: Proprietary Audible tags

The newer ATL versions seem to have absorbed some of the proprietary Audible tags and converted them into standard tags. Unfortunately my app wasn't aware of that. From those I read it affected "@pub" which became Publisher and "@des" which became Description. The one that did not change is "@nrt" which stores the narrator(s) of the book. If you converted this one, too, I'd no longer need to look for any custom tags. Narrator(s) could be mapped to AlbumArtist(s)

Note: MD does funny things here: The "@" tags are all lower case.

Zeugma440 commented 1 year ago

Welcome back !

About the year / date thing, it's been changed in v4.09, following #155. I'll have a go at it this week-end but I think we'll have no other choice but to add a new flag to Settings to switch between both behaviours.

About the proprietary Audible tags, I didn't really get if there's anything to change or explain on my side. You'll find the full changelog for that on v4.12.

audiamus commented 1 year ago

but I think we'll have no other choice but to add a new flag to Settings to switch between both behaviours.

That would be fine with me.

About the proprietary Audible tags, I didn't really get if there's anything to change or explain on my side.

It's only the @nrt tag left. It's the last one from Atl.Track.AdditionalFields that I read that is still just a dictionary item and not a property of its own in the Track class, after @des and @pub became full properties. But I can live with that, no problem.

Zeugma440 commented 1 year ago

Regarding the date vs. year issue on MP4/M4A files, I found a tweak based on Track setters to keep both behaviours without adding any additional setting flag :)

Now it saves YYYY when you set Track.Year and saves YYYY-MM-DD when you set Track.Date. If you set both, it's time to choose your side 😉

=> Available in today's v4.20

Plus there's a comprehensive unit test dedicated to that : https://github.com/Zeugma440/atldotnet/blob/77f21dbfece8edbd2ff3a94e2dcab675e4b48aab/ATL.test/IO/HighLevel.cs#L1138


Regarding the "Narrator" field, it's unfortunately unique to the MP4/M4A standard, and I can't map it to "Album Artist" either, as that field already has a mapping in that standard (aART).

I fear you'll have to keep using additional Track.AdditionalFields for that one.

Zeugma440 commented 1 year ago

Available in v4.20

audiamus commented 1 year ago

Excellent, thanks a lot.

orbittwz commented 1 year ago

writing FLAC YEAR tag as XXXX shows up as XXXX-XX-XX, using latest version 4.26. what gives? I'm setting trackdata.year to XXXX and saving track.

orbittwz commented 1 year ago

You probably want to check MP3 as well... just in case it's affecting it also.