Andrew McGuinness wrote:
The "very simplistic" oggtagreader.pm code doesn't work on my Ogg
files - it produces a random punctuation character at the end of many
of the Artist names.
The correct code for reading Ogg comment tags is in ogginfo.pm anyway
- the following patch uses it instead of oggtagreader.pm .
oggtagreader.pm becomes obsolete:
========================
Previous patch misses the track number - correction:
darjeeling gnump3d $ diff readtags.pm.orig readtags.pm
9d8
< use gnump3d::oggtagreader; # Local vorbis code
177,179c176,180
<
< my $comment = gnump3d::oggtagreader->new( );
< my %tags = $comment->getTags($file);
---
> my %tags;
> foreach my $ckey ( $reader->comment_tags() )
> {
> $tags{lc($ckey)} = ($reader->comment( $ckey ))[0];
> }
186c187
< $TAGS{'TRACK'} = $tags{'track'} || "";
---
> $TAGS{'TRACK'} = $tags{'tracknumber'} || "";
189c190
< $TAGS{'YEAR'} = $tags{'year'} || "";
---
> $TAGS{'YEAR'} = $tags{'date'} || "";