Skip Menu |

This queue is for tickets about the MP3-Tag CPAN distribution.

Report information
The Basics
Id: 72793
Status: new
Priority: 0/
Queue: MP3-Tag

People
Owner: Nobody in particular
Requestors: bryan.richter [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.13
Fixed in: (no value)



Subject: Blank TPOS causes disk_alphanum to return '`'
If TPOS is defined but blank, audio_rename emits Argument "" isn't numeric in numeric le (<=) at /usr/share/perl5/MP3/Tag.pm line 586. Further, disk_alphanum returns '`', since that is the result of chr(ord('a') - 1 + $r1) when $r1 eq ''. This affects the filename of the file being processed. While it may be (?) that any program that writes a blank TPOS entry may be buggy itself, it would be nice if audio_rename handled this situation gracefully. Perhaps the following would work? It is untested as I'm not savvy enough to force a program to use a local library over a system library. diff --git a/lib/MP3/Tag.pm b/lib/MP3/Tag.pm index 87b4365..3cfebe1 100755 --- a/lib/MP3/Tag.pm +++ b/lib/MP3/Tag.pm @@ -580,7 +580,7 @@ sub disk2 ($) { sub disk_alphanum ($) { my $self = shift; my $r = $self->select_id3v2_frame('TPOS'); - return '' unless defined $r; + return '' unless defined $r && $r =~ /\d/; (my $r1 = $r) =~ s(/.*)()s; $r = $r1 unless $r =~ s(^.*?/)()s; # max(disk2, disk1) return chr(ord('a') - 1 + $r1) if $r <= 26;