* Don't store empty metadata values.

This commit is contained in:
Justin Maggard 2009-05-12 01:15:01 +00:00
parent 2e27960e10
commit f64e458729

View File

@ -199,6 +199,7 @@ vc_scan(struct song_metadata *psong, const char *comment, const size_t length)
} }
else if(!strncasecmp(strbuf, "ARTIST=", 7)) else if(!strncasecmp(strbuf, "ARTIST=", 7))
{ {
if( *(strbuf+7) )
psong->contributor[ROLE_ARTIST] = strdup(strbuf + 7); psong->contributor[ROLE_ARTIST] = strdup(strbuf + 7);
} }
else if(!strncasecmp(strbuf, "ARTISTSORT=", 11)) else if(!strncasecmp(strbuf, "ARTISTSORT=", 11))
@ -207,6 +208,7 @@ vc_scan(struct song_metadata *psong, const char *comment, const size_t length)
} }
else if(!strncasecmp(strbuf, "TITLE=", 6)) else if(!strncasecmp(strbuf, "TITLE=", 6))
{ {
if( *(strbuf+6) )
psong->title = strdup(strbuf + 6); psong->title = strdup(strbuf + 6);
} }
else if(!strncasecmp(strbuf, "TRACKNUMBER=", 12)) else if(!strncasecmp(strbuf, "TRACKNUMBER=", 12))
@ -219,6 +221,7 @@ vc_scan(struct song_metadata *psong, const char *comment, const size_t length)
} }
else if(!strncasecmp(strbuf, "GENRE=", 6)) else if(!strncasecmp(strbuf, "GENRE=", 6))
{ {
if( *(strbuf+6) )
psong->genre = strdup(strbuf + 6); psong->genre = strdup(strbuf + 6);
} }
else if(!strncasecmp(strbuf, "DATE=", 5)) else if(!strncasecmp(strbuf, "DATE=", 5))
@ -241,6 +244,7 @@ vc_scan(struct song_metadata *psong, const char *comment, const size_t length)
} }
else if(!strncasecmp(strbuf, "COMMENT=", 8)) else if(!strncasecmp(strbuf, "COMMENT=", 8))
{ {
if( *(strbuf+8) )
psong->comment = strdup(strbuf + 8); psong->comment = strdup(strbuf + 8);
} }
else if(!strncasecmp(strbuf, "MUSICBRAINZ_ALBUMID=", 20)) else if(!strncasecmp(strbuf, "MUSICBRAINZ_ALBUMID=", 20))