diff options
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) |