Like all your thinking AnalogKid
To be clear while tagging offers a number of dates, Kodi currently only stores year (of the last date tag it encounters), and sorts by that. It seems to date from id3v1.1 that only has a year tag. We do need to think about other tag formats than just ID3. At the moment the date related tags Kodi processes and stores as year are
TDRL or TDRC (id3v2.4) - extracting year.
TYER (id3v2.3)
YEAR (APE or Vorbis or id3v1.1)
DATE (Vorbis)
WM/Year (ASF)
"\251day" (iTunes MP4)
In the ID3v2.4 standard it is clear what the dates are
Code:
TDOR
The 'Original release time' frame contains a timestamp describing when the original recording of the audio was released.
TDRC
The 'Recording time' frame contains a timestamp describing when the audio was recorded.
TDRL
The 'Release time' frame contains a timestamp describing when the audio was first released.
but I am not so sure about the other file/tag formats.
Musicbrainz Picard uses
release date: TDRC (id3v24), TYER+ TDAT (id3v23), DATE (Vorbis), Year (APEv2), ©day (MP4), WM/Year (ASF)
Original Release Date: TDOR (id3v24), TORY (id3v23), ORIGINALDATE (Vorbis), WM/OriginalReleaseTime (ASF)
Original Release Year: ORIGINALYEAR (Vorbis and APEv2), WM/OriginalReleaseYear (ASF)
Notice it does not use TDRL nor does it have every kind of date in every file format. The date section summary here
http://wiki.hydrogenaud.io/index.php?title=Tag_Mapping is interesting too. What that shows is that we can expect to get a year but more than that isn't always available.
The years node depends on albums/songs table having a year field, so I propose we keep that but make it clear how that field gets populated when songs are tagged with several dates. I also suspect that sorting by an integer value like year is quicker than sorting by a full date. Sorting by a field requires every record to have a value for that field, so what to do if all we have is a year? Take it as 1st Jan I guess?
What I'm not sure about, given much older music will just have a year tag, is do we add 3 date fields (like the ID3v2.4 spec) or 2 (as Picard supports).