Menu

#96 import.pl tries to add numeric genres to genre table

open
nobody
None
5
2004-11-27
2004-11-27
No

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.

Discussion

  • William Skellenger

    Patch import.pl to fix numeric genre bug

     
  • Lewis Jardine

    Lewis Jardine - 2004-12-08

    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);'

     

Log in to post a comment.