FS#6546 - Parse Year from "Date" Field

Attached to Project: Rockbox
Opened by Reza (afruff23) - Thursday, 18 January 2007, 02:31 GMT
Task Type Feature Requests
Category ID3 / meta data
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This is really for Vorbis comments, but I guess it would work for some ID3 tags. This assumes people use the format "2006-11-30" for the "Date" field as musicbrainz and picard already does. When you use the database, it would consider this file as under the year 2006.
This task depends upon

Closed by  Bj√∂rn Stenberg (zagor)
Monday, 05 March 2007, 20:10 GMT
Reason for closing:  Fixed
Additional comments about closing:  Closing all feature requests.
Comment by Reza (afruff23) - Thursday, 18 January 2007, 09:04 GMT
"Date" is the actual name of the field. "Year" is not a standard field. So instead, make this feature just parse the first 4 numbers of the "Date" field.
Comment by Mark Arigo (lowlight) - Thursday, 18 January 2007, 19:38 GMT
I would not suggest parsing the "date" vorbis comment to try to extract a year since the format of the date field can be anything. Instead, I would propose adding a "year" vorbis comment that is specifically a 4-digit numerical year. Obviously users would have to update their tags, but that's easy to do with a mass tagger. This approach would also fix this related bug:
Comment by Reza (afruff23) - Thursday, 18 January 2007, 22:12 GMT
That is not a bug that you linked to. "Year" is not a standard field. It is simply called that in programs like winamp. If you open the correctly tagged files in fb2k it gives you the actual field name "Date". That bug is due to user error. My FR simply parses data from a standard format in a standard field. Even Winamp already parses the "Date" field correctly and shows that I have a file from year 1996 when the "Date" field says "1996-08-30".
Comment by Mark Arigo (lowlight) - Friday, 19 January 2007, 16:18 GMT
The "date" field is ARBITRARY text (just like all vorbis comments). There is no standard format. While you may use "1996-08-30" others may have "Aug 30, 1996" or "08/30/96" or "30-Aug-96" etc. This makes it difficult to correctly parse the year out of the tag for ALL users. That's why I suggest adding a "year" tag that is a 4-digit numerical year, ie "1996". I am aware that "year" is a non-standard vorbis comment field from the standpoint that other software may not automatically add/read this tag. However, that does not prevent you from adding it since vorbis comments can contain any "field name" + "field value" combination you want. For example, in foobar2000, select all the tracks with the same year, then use the masstagger to add a tag with field name=year and field value=1996. What's easier...coding to extract the year from an infinite number of date variations or relying on the user to add a correct year tag? I vote for the latter.

Having said that...nothing prevents you from making your own custom build to extract the year from your date tags, in fact it's quite easy using your format. I'll get you started...apps/metadata.c line 264:
Comment by Eddy (bascule) - Monday, 05 March 2007, 19:07 GMT
This can be closed, committed on 5th March 2007.