Index: apps/metadata/id3tags.c =================================================================== --- apps/metadata/id3tags.c (Revision 30485) +++ apps/metadata/id3tags.c (Arbeitskopie) @@ -266,31 +266,41 @@ /* parse numeric genre from string, version 2.2 and 2.3 */ static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos ) { - /* Use bufferpos to hold current position in entry->id3v2buf. */ - bufferpos = tag - entry->id3v2buf; + /* Do not overwrite exsiting metadata. Results in keeping the first genre + * from tags with multiple gernes. */ + if (entry->genre_string == NULL) + { + /* Use bufferpos to hold current position in entry->id3v2buf. */ + bufferpos = tag - entry->id3v2buf; - if(entry->id3version >= ID3_VER_2_4) { - /* In version 2.4 and up, there are no parentheses, and the genre frame - is a list of strings, either numbers or text. */ + if(entry->id3version >= ID3_VER_2_4) { + /* In version 2.4 and up, there are no parentheses, and the genre frame + is a list of strings, either numbers or text. */ - /* Is it a number? */ - if(isdigit(tag[0])) { - entry->genre_string = id3_get_num_genre(atoi( tag )); - return bufferpos; + /* Is it a number? */ + if(isdigit(tag[0])) { + entry->genre_string = id3_get_num_genre(atoi( tag )); + return bufferpos; + } else { + entry->genre_string = tag; + return bufferpos + strlen(tag) + 1; + } } else { - entry->genre_string = tag; - return bufferpos + strlen(tag) + 1; + if( tag[0] == '(' && tag[1] != '(' ) { + entry->genre_string = id3_get_num_genre(atoi( tag + 1 )); + return bufferpos; + } + else { + entry->genre_string = tag; + return bufferpos + strlen(tag) + 1; + } } - } else { - if( tag[0] == '(' && tag[1] != '(' ) { - entry->genre_string = id3_get_num_genre(atoi( tag + 1 )); - return bufferpos; - } - else { - entry->genre_string = tag; - return bufferpos + strlen(tag) + 1; - } } + else + { + /* nothing changed */ + return bufferpos; + } } #ifdef HAVE_ALBUMART