Subject: | error writing metadata with arrays |
Date: | Sun, 2 Nov 2014 19:41:32 +0100 |
To: | bug-Audio-FLAC-Header [...] rt.cpan.org |
From: | Rolf Rander Næss <rolf.ness [...] pvv.org> |
The code for reading metadata specifically handles the case where there are
several instances of the same tag. But when writing this back to the
flac-file, it is written as 'ARRAY(0xXXXXXX).
I have a suggested fix for this (but I am not a perl-programmer, so I just
found something that worked for me, this is possibly not the most elegant
way of doing it)
***************
*** 221,236 ****
foreach (keys %{$self->{'tags'}}) {
unless (/^VENDOR$/) {
! if(ref($self->{'tags'}{$_}) eq 'ARRAY') {
! my $key = $_;
! for my $value (@{$self->{'tags'}->{$_}}) {
! push @tagString, $key . "=" .
$value;
! $numTags++;
! }
! } else {
! push @tagString, $_ . "=" .
$self->{'tags'}{$_};
! $numTags++;
! }
}
}
--- 221,228 ----
foreach (keys %{$self->{'tags'}}) {
unless (/^VENDOR$/) {
! push @tagString, $_ . "=" . $self->{'tags'}{$_};
! $numTags++;
}
}