Should ID3v1 setGenre be case sensitive?

Issue #342 resolved
Dan Gravell created an issue

ID3v1 tags have to have genres from a pre-defined set, we all know that!

Currently in Jaudiotagger this is how it’s done:

    Integer genreID = GenreTypes.getInstanceOf().getIdForValue(genreVal);

getIdForValue performs a plain lookup on the valueToId Map, which is therefore case sensitive.

This means:

tag.setGenre(“Disco”)

works, but:

tag.setGenre(“disco”)

… doesn’t. In fact it is set to nothing - it fails silently (see #339).

Given that it just boils down to a numeric identifier anyway, I wonder if we should perform a case insensitive match?

Comments (1)

  1. Dan Gravell reporter

    D'oh - just noticed there's also nameToIdMap which stores in lower case to enable case insensitive lookups...

  2. Log in to comment