Subject: | Cannot set genre to Blues or (0) |
Date: | Mon, 1 Mar 2010 16:51:33 -0800 (PST) |
To: | bug-MP3-Tag [...] rt.cpan.org |
From: | Eric Benson <eric_a_benson [...] yahoo.com> |
Using MP3-Tag-1.12 with Perl 5.10.1, I cannot create a TCON frame with the string "Blues" or "(0)" as the value. It gets converted into a numeric value "0", which is interpreted as the genre with the name "0" rather than the ID3 genre numbered 0, which is Blues. I believe this is caused by a bug in the function MP3::Tag::Implemenation::_massage_genres. The line that reads
$genre = "($genre)" if $genre and not $genre =~ /\D/; # Only digits
should instead just read
$genre = "($genre)" unless $genre =~ /\D/; # Only digits
I believe this is always correct because $genre cannot be undefined or an empty string at this point, and if it is the number 0 or the string "0" then it should be considered the ID3 genre 0, or Blues.