dhamaniasad / mutagen

Automatically exported from code.google.com/p/mutagen
GNU General Public License v2.0
2 stars 1 forks source link

Save of genre TCON tag in mp3 incorrect if numeric genre > GENRES list. #149

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In id3.py in __get_genres the handling of numeric genres is incorrect if they 
are e.g. years rather than an index into the ID3v1 genre list in the GENRES 
constant.

Code says:

            if value.isdigit():
                try: genres.append(self.GENRES[int(value)])
                except IndexError: genres.append(u"Unknown")

And IMO it should be:

            if value.isdigit():
                try: genres.append(self.GENRES[int(value)])
                except IndexError: genres.append(value)

Thanks.

S

Original issue reported on code.google.com by Sophist...@gmail.com on 24 May 2013 at 3:17

GoogleCodeExporter commented 9 years ago
Upon consideration I am not sure whether it should return "Unknown" for values 
<=255 and the value if > 255. I am finding a lot of tracks with a value of 255 
which I am assuming means "Unknown" since this is not a defined ID3v1 value.

Original comment by Sophist...@gmail.com on 24 May 2013 at 4:08

GoogleCodeExporter commented 9 years ago
Or perhaps just ignore values <=255 which are invalid.

Original comment by Sophist...@gmail.com on 24 May 2013 at 4:13

GoogleCodeExporter commented 9 years ago
This issue was closed by revision fc8fc586aac9.

Original comment by reiter.christoph@gmail.com on 4 Sep 2013 at 4:22

GoogleCodeExporter commented 9 years ago
related: I've updated the genre list in revision be7d0840b7a8

Original comment by reiter.christoph@gmail.com on 4 Sep 2013 at 4:23