I tried your plugin with an MP3 using the following script: ---- [% USE songfile = MP3( "/home/doug/eminem/mp3s/square_dance.mp3" ) %]
Artist: [% songfile.artist %] Title: [% songfile.title %] Album: [% songfile.album %] Track: [% songfile.tracknum %] Running Time: [% songfile.time %] ---- The output I got was the following: ---- Use of uninitialized value in sprintf at /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/Template/Plugin/MP3.pm line 35. Use of uninitialized value in sprintf at /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/Template/Plugin/MP3.pm line 35. No method 'TRACKNUM' available in package MP3::Info. at /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/Template/Plugin/MP3.pm line 84 Artist: Eminem Title: Square Dance Album: The Eminem Show Track: 1 Running Time: 05:23 ---- The first two errors are simply because there's no keyword substitution going on in the file. I fixed up my copy so it would avoid the third error, and attached the patch; please let me know if this is useful or not. Thanks, Doug Gorley | [EMAIL PROTECTED] OpenPGP Key ID: 0xA221559B Fingerprint: D707 DB92 E64B 69DA B8C7 2F65 C5A9 5415 A221 559B Interested in public-key cryptography? http://www.gnupg.org/ 2002-11-05 at 19:42, darren chamberlain wrote: > As I found myself creating several directories full of HTML files for my > MP3 collection, I realized that I needed Template::Plugin::MP3, so I > wrote it. It's a wrapper around Pudge's MP3::Info (read-only access, > though). > > Basic usage is straightforward: > > [% USE songfile = MP3("Camarillo_Brillo.mp3") %] > > Artist: [% songfile.artist %] > Title: [% songfile.title %] > Album: [% songfile.album %] > Track: [% songfile.tracknum %] > Running Time: [% songfile.time %] > > And so on. Comments? > > (darren) > > -- > An idea is not responsible for the people who believe in it. > > _______________________________________________ > templates mailing list > [EMAIL PROTECTED] > http://www.template-toolkit.org/mailman/listinfo/templates
--- /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/Template/Plugin/MP3.pm Thu
Nov 7 00:06:55 2002
+++ perl_modules/Template/Plugin/MP3.pm Thu Nov 7 00:48:18 2002
@@ -81,7 +81,14 @@
my $self = shift;
(my $a = $AUTOLOAD) =~ s/.*:://;
- $self->{ _MP3 }->$a(@_);
+ if ( exists $self->{ _MP3 }->{uc $a} )
+ {
+ return $self->{ _MP3 }->$a(@_) ;
+ }
+ else
+ {
+ return undef ;
+ }
}
sub mp3_genres { [ @MP3::Info::mp3_genres ] }
signature.asc
Description: This is a digitally signed message part
