Mp4s can end up with two types of genre
From https://java.net/jira/browse/JAUDIOTAGGER-442
With Mp4s obviously there is a distinction between "valid" and custom genres.
If I start off with a track with a valid genre like "Ethnic" and want to change this into a custom genre like "myOwnGenre" I run into a problem, if I use the generic FieldKey:
I write the custom genre with au.getTag().setField(FieldKey.GENRE, "myOwnGenre"); au.commit(); Now I have 2 genres in the file, because jaudiotagger added a Mp4TagTextField withoug removing the old Mp4GenreField. That's not really what I intended. I wanted to replace it, not add it. The problem shows when I retrieve the genre with String s = au.getTag().getFirst(FieldKey.GENRE); because I get the valid genre and not my newly set custom genre.
Of course I can access the custom genre with String s = au.getTag().getFirst(Mp4FieldKey.GENRE_CUSTOM.getFieldName()); but that's illogical and contradictory to the generic approach.
Comments (2)
-
reporter -
reporter - changed status to closed
Fixed,
- Log in to comment
This may be an old issue because the setField() code does currently delete other genre field
but now added test to proof it
however there is a related bug in deleteField(FieldKey genericKey) that meant only one of the fields was being deleted so fixed and added test for that as well.