diff options
author | Dan Everton <dan@iocaine.org> | 2007-03-05 09:04:03 +0000 |
---|---|---|
committer | Dan Everton <dan@iocaine.org> | 2007-03-05 09:04:03 +0000 |
commit | 1b2a1c8fe71e27c53c284535997cb07ac8e49536 (patch) | |
tree | aad0a0dad1d3352a882359f6143df33d0e560a8a /apps | |
parent | 3d4d5175b006743a21392364b20ec192a0ac32b8 (diff) | |
download | rockbox-1b2a1c8fe71e27c53c284535997cb07ac8e49536.tar.gz rockbox-1b2a1c8fe71e27c53c284535997cb07ac8e49536.zip |
Try and parse Ogg 'date' tags. Will only work if your date tags start with the year (e.g. yyyy-MM-dd). Which should be most people.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12622 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/metadata.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/metadata.c b/apps/metadata.c index 8fdd776323..869e4b9b81 100644 --- a/apps/metadata.c +++ b/apps/metadata.c | |||
@@ -219,14 +219,16 @@ static long parse_tag(const char* name, char* value, struct mp3entry* id3, | |||
219 | else if (((strcasecmp(name, "year") == 0) && (type == TAGTYPE_APE)) | 219 | else if (((strcasecmp(name, "year") == 0) && (type == TAGTYPE_APE)) |
220 | || ((strcasecmp(name, "date") == 0) && (type == TAGTYPE_VORBIS))) | 220 | || ((strcasecmp(name, "date") == 0) && (type == TAGTYPE_VORBIS))) |
221 | { | 221 | { |
222 | /* Date can be in more any format in a Vorbis tag, so don't try to | 222 | /* Date's can be in any format in Vorbis. However most of them |
223 | * parse it. | 223 | * are in ISO8601 format so if we try and parse the first part |
224 | * of the tag as a number, we should get the year. If we get crap, | ||
225 | * then act like we never parsed it. | ||
224 | */ | 226 | */ |
225 | if (type != TAGTYPE_VORBIS) | 227 | id3->year = atoi(value); |
226 | { | 228 | if (id3->year < 1900) |
227 | id3->year = atoi(value); | 229 | { /* yeah, not likely */ |
230 | id3->year = 0; | ||
228 | } | 231 | } |
229 | |||
230 | p = &(id3->year_string); | 232 | p = &(id3->year_string); |
231 | } | 233 | } |
232 | else if (strcasecmp(name, "title") == 0) | 234 | else if (strcasecmp(name, "title") == 0) |