VERSION => '0.001001',
PREREQ_PM => {
'Audio::FLAC::Header' => 0,
- 'HTML::Entities' => 0,
'HTML::Template::Compiled' => 0,
'Memoize' => 0,
'MP3::Tag' => 0,
- 'URI::Escape' => 0,
'DB_File' => 0,
},
MIN_PERL_VERSION => 5.014,
use warnings;
use Audio::FLAC::Header qw//;
-use HTML::Entities qw/encode_entities/;
use HTML::Template::Compiled qw//;
use Memoize qw/memoize/;
use MP3::Tag qw//;
-use URI::Escape qw/uri_escape/;
use DB_File qw//;
use File::Basename qw/fileparse/;
sub fix{
utf8::decode($_[0]);
- encode_entities($_[0])
}
sub flacinfo{
my $file=$_[0];
my $flac=Audio::FLAC::Header->new($file);
- $file = $prefix . uri_escape scalar fileparse $file;
+ $file = $prefix . scalar fileparse $file;
freeze +{
format => 'FLAC',
sub mp3info{
my $file=$_[0];
my $mp3=MP3::Tag->new($file);
- $file = $prefix . uri_escape scalar fileparse $file;
+ $file = $prefix . scalar fileparse $file;
freeze +{
format => 'MP3',
push @files, thaw mp3info $file if $file =~ /.mp3$/i;
}
- my $ht=HTML::Template::Compiled->new( $template eq '' ? (scalarref => \$default_template) : (filename => $template));
+ my $ht=HTML::Template::Compiled->new(
+ default_escape => 'HTML',
+ $template eq '' ? (scalarref => \$default_template) : (filename => $template),
+ );
$ht->param(files=>[sort { $a->{title} cmp $b->{title} } @files]);
print $ht->output;
}
<thead>
<tr><th>Title<th>Artist<th>Album<th>Genre<th>Track<th>Year<th>Type
<tbody><tmpl_loop files>
-<tr><td><a href="<tmpl_var path>"><tmpl_var title></a><td><tmpl_var artist><td><tmpl_var album><td><tmpl_var genre><td><tmpl_var tracknumber>/<tmpl_var tracktotal><td><tmpl_var year><td><tmpl_var format></tmpl_loop>
+<tr><td><a href="<tmpl_var ESCAPE=URL path>"><tmpl_var title></a><td><tmpl_var artist><td><tmpl_var album><td><tmpl_var genre><td><tmpl_var tracknumber>/<tmpl_var tracktotal><td><tmpl_var year><td><tmpl_var format></tmpl_loop>
</table>
HTML