]> iEval git - app-musicexpo.git/commitdiff
Replace json with classes
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 2 Apr 2015 11:27:06 +0000 (14:27 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 2 Apr 2015 11:27:06 +0000 (14:27 +0300)
Makefile.PL
lib/App/MusicExpo.pm

index 41dbd892f88685649b8704b51e9d914e1edff4db..89e82bd8f01398b051c72a11c0239892f877c3bc 100644 (file)
@@ -16,7 +16,6 @@ WriteMakefile(
                   Memoize                       0
                   MP3::Tag                      1.12
                   MP4::Info                     0
-                  JSON::MaybeXS                 0
                   DB_File                       0
                   Ogg::Vorbis::Header::PurePerl 0/,
        },
index dd3e57565591620d7ab4ff9070e308618f3d1bf0..a9a9058d47e5951578a4cd8c8450d1b91e587794 100644 (file)
@@ -16,7 +16,6 @@ use DB_File qw//;
 use File::Basename qw/fileparse/;
 use Fcntl qw/O_RDWR O_CREAT/;
 use Getopt::Long;
-use JSON::MaybeXS;
 use Storable qw/thaw freeze/;
 
 ##################################################
@@ -164,10 +163,7 @@ sub run {
        }
 
        @files = sort { $a->{title} cmp $b->{title} } @files;
-       my $json = JSON::MaybeXS->new(canonical => 1)->encode({files => \@files, prefix => $prefix});
-       $json =~ s/</&lt;/g;
-       $json =~ s/>/&gt;/g;
-       $ht->param(files => \@files, prefix => $prefix, json => $json);
+       $ht->param(files => \@files, prefix => $prefix);
        print $ht->output;
 }
 
@@ -184,10 +180,8 @@ $default_template = <<'HTML';
 <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;
This page took 0.026941 seconds and 4 git commands to generate.