This is the main reason for my last bug report, that
the genre ids don't follow any known convention.
Some ripping programs, such as Grip, will by default
tag the file with a numeric genre. (-G %g) The user
should probably change this to (-G %G) to get the genre
as a string.
The problem is that import.pl will see the numeric
genre and attempt to add it to the genres table.
Attaching a patch to fix this behavior.
First I attempt to determine if the genre is a
number... If it is, it will return the unaltered
numeric value. If not, proceed with attempting to
retrieve the ID based on the string value.
THIS WILL ONLY BE CORRECT if the genre table is
following some sort of convention as I reported earlier.
Patch import.pl to fix numeric genre bug
Logged In: YES
user_id=436862
Possibly a better solution would be to use MP3::Info's genre
lookup table? I'm not too familiar with Perl modules, but it
would seem you can import its lookup table into your
namespace and then use it to turn a genre number into a
genre string?
Its documentation
(http://search.cpan.org/~cnandor/MP3-Info-1.01/Info.pm)
reckons that 'You can import the data structures with one of:
use MP3::Info qw(:genres);
use MP3::Info qw(:DEFAULT :genres);
use MP3::Info qw(:all);'