use File::Basename qw/fileparse/;
use Fcntl qw/O_RDWR O_CREAT/;
use Getopt::Long;
-use JSON::MaybeXS;
use Storable qw/thaw freeze/;
##################################################
}
@files = sort { $a->{title} cmp $b->{title} } @files;
- my $json = JSON::MaybeXS->new(canonical => 1)->encode({files => \@files, prefix => $prefix});
- $json =~ s/</</g;
- $json =~ s/>/>/g;
- $ht->param(files => \@files, prefix => $prefix, json => $json);
+ $ht->param(files => \@files, prefix => $prefix);
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><tmpl_var title><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_loop formats><a href="<tmpl_var ...prefix><tmpl_var ESCAPE=URL file>"><tmpl_var format></a> </tmpl_loop></tmpl_loop>
+<tr><td class="title"><tmpl_var title><td class="artist"><tmpl_var artist><td class="album"><tmpl_var album><td class="genre"><tmpl_var genre><td class="track"><tmpl_var tracknumber>/<tmpl_var tracktotal><td class="year"><tmpl_var year><td class="formats"><tmpl_loop formats><a href="<tmpl_var ...prefix><tmpl_var ESCAPE=URL file>"><tmpl_var format></a> </tmpl_loop></tmpl_loop>
</table>
-
-<pre id="json" style="display: none"><tmpl_var ESCAPE=0 json></pre>
HTML
1;