Bug 4927 - ID3v2.4 date tags ignored
: ID3v2.4 date tags ignored
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Tagging
: 6.5.1
: All All
: P2 normal (vote)
: ---
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-19 09:45 UTC by Illya
Modified: 2007-10-23 12:24 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments
patch for Schema.pm, possible fix for this bug (510 bytes, patch)
2007-04-19 15:51 UTC, Illya
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Illya 2007-04-19 09:45:13 UTC
ID3 v2.4 allows for date fields, like TDRC, to look like 2007-04-19.  SlimServer looks in TDRC for the album year, but if a track is tagged with a date including month and day, rather than taking the first four digits as the year, it does not process the tag at all.  This seems to be due to the code used to fix bug 2610 in Schema.pm; it shouldn't be difficult to recognize a YYYY-MM-DDTHH:MM-style valid ID3v2.4 date and strip out the year before entering it into the database.

For reference, here is a description of timestamps allowed by v2.4, from http://www.id3.org/id3v2.4.0-structure :
The timestamp fields are based on a subset of ISO 8601. When being as
   precise as possible the format of a time string is
   yyyy-MM-ddTHH:mm:ss (year, "-", month, "-", day, "T", hour (out of
   24), ":", minutes, ":", seconds), but the precision may be reduced by
   removing as many time indicators as wanted. Hence valid timestamps
   are
   yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddTHH, yyyy-MM-ddTHH:mm and
   yyyy-MM-ddTHH:mm:ss. All time stamps are UTC. For durations, use
   the slash character as described in 8601, and for multiple non-
   contiguous dates, use multiple strings, if allowed by the frame
   definition.
Comment 1 Spies Steven 2007-04-19 15:16:20 UTC
Easily reproduced.
Comment 2 Illya 2007-04-19 15:51:10 UTC
Created attachment 1908 [details]
patch for Schema.pm, possible fix for this bug

Adding this check at line 1592 in Schema.pm (slimserver 6.5.1) seems to fix at least most cases in my collection:

        if ($attributes->{'YEAR'} && $attributes->{'YEAR'} =~ m/^(\d+)-\d+(-\d+(T\d+(:\d+(:\d+)?)?)?)?$/) {
            $attributes->{'YEAR'} = $1;
        }

A patch is attached.
Comment 3 Andy Grundman 2007-10-23 12:24:22 UTC
I've fixed this in change 14042 for MP3 files.