Since Version 0.09 there were some changes in Audio::File::Mp3::Tag
concerning the track-tag. The code in version 0.08 is:
Show quoted text
> $self->track( $track );
and was exchanged by the following code in version 0.11:
Show quoted text> my $track = $info->{track};
> my $pos = index($track, '/');
> $self->track ( substr($track, 0, $pos) );
On my first sight, I didn't find a song in my collection which has a
slash in the track field and didn't got an idea why there should be one.
With all my test files $pos is -1, $self->track is set to an empty
string and I get a syntax error to line 162 in Audio::File::Tag.
I attached a patch, which looks for a slash for compatibity and only
uses the substring if there is one.
Subject: | track-tag.patch |
diff -Naur Audio.orig/File/Mp3/Tag.pm Audio/File/Mp3/Tag.pm
--- Audio.orig/File/Mp3/Tag.pm 2006-08-25 15:20:43.000000000 +0200
+++ Audio/File/Mp3/Tag.pm 2009-04-25 18:30:01.484124806 +0200
@@ -13,8 +13,15 @@
$self->{mp3}->get_tags();
my $info = $self->{mp3}->autoinfo;
+ # checking for a slash in the track tag and only use the prefix
+ # this is only for compatibility reasons with per-0.11 versions
my $track = $info->{track};
my $pos = index($track, '/');
+ if ($pos != -1) {
+ $self->track ( substr($track, 0, $pos) );
+ } else {
+ $self->track ( $track );
+ }
$self->title ( $info->{ title } );
$self->artist ( $info->{ artist } );
@@ -22,7 +29,6 @@
$self->comment( $info->{ comment } );
$self->genre ( $info->{ genre } );
$self->year ( $info->{ year } );
- $self->track ( substr($track, 0, $pos) );
$self->total ( substr($track, $pos + 1) );
return 1;