Catch eyeD3.tag.GenreException from mp3 files with bad genre
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Entertainer Media Center |
New
|
Undecided
|
Unassigned |
Bug Description
I'm testing entertainer 0.5.1 compiled from source on Ubuntu Lucid.
One of my mp3 files had the following as the ID3 genre field: CLASSICAL(
The eyeD3 library does not like this (I guess due to the brackets) and as it fails it regular expression test throws eyeD3.tag.
2010-09-08 15:29:41+0100 [-] Exception in thread IndexerThread:
2010-09-08 15:29:41+0100 [-] Traceback (most recent call last):
2010-09-08 15:29:41+0100 [-] File "/usr/lib/
2010-09-08 15:29:41+0100 [-] self.run()
2010-09-08 15:29:41+0100 [-] File "/home/
2010-09-08 15:29:41+0100 [-] cache.addDirect
2010-09-08 15:29:41+0100 [-] File "/home/
2010-09-08 15:29:41+0100 [-] self.addFile(
2010-09-08 15:29:41+0100 [-] File "/home/
2010-09-08 15:29:41+0100 [-] self.__
2010-09-08 15:29:41+0100 [-] File "/home/
2010-09-08 15:29:41+0100 [-] genre = str(tags.
2010-09-08 15:29:41+0100 [-] File "/usr/lib/
2010-09-08 15:29:41+0100 [-] g.parse(f[0].text);
2010-09-08 15:29:41+0100 [-] File "/usr/lib/
2010-09-08 15:29:41+0100 [-] (regex.pattern, genreStr));
2010-09-08 15:29:41+0100 [-] GenreException: Genre string cannot be parsed with '^[A-Z 0-9+/\-
2010-09-08 15:29:41+0100 [-]
My suggested fix is to replace this in file entertainerlib/
# Get track genre
genre = str(tags.
if genre is None or len(genre) == 0:
genre = self.__
with this new code:
# Get track genre
try:
genre = str(tags.
except eyeD3.tag.
#raised on some ID3 genre strings, e.g. containing brackets
genre = None
if genre is None or len(genre) == 0:
genre = self.__
This means the genre for such problem files is ignored, but the rest of the data is parsed and the file should then appear in the library.
Perhaps a bug should be filed in eyeD3 as well?