X-Git-Url: http://git.ieval.ro/?p=app-musicexpo.git;a=blobdiff_plain;f=lib%2FApp%2FMusicExpo.pm;h=32715ae1680671c029729fa65b99f926670be995;hp=60c5c087156164daec33bcb3d09cdb3b13537052;hb=95267d4f67d75e452bdfe9f92260dd0a65a9b39e;hpb=598a92c5fd17bb4e57ad3ab108c8fb394fae0c90 diff --git a/lib/App/MusicExpo.pm b/lib/App/MusicExpo.pm index 60c5c08..32715ae 100644 --- a/lib/App/MusicExpo.pm +++ b/lib/App/MusicExpo.pm @@ -15,6 +15,7 @@ use DB_File qw//; use File::Basename qw/fileparse/; use Fcntl qw/O_RDWR O_CREAT/; use Getopt::Long; +use JSON; use Storable qw/thaw freeze/; ################################################## @@ -128,7 +129,10 @@ sub run { push @files, \%entry } - $ht->param(files=>[sort { $a->{title} cmp $b->{title} } @files], prefix => $prefix); + my $json = JSON->new->utf8->canonical->encode({files => \@files, prefix => $prefix}); + $json =~ s//>/g; + $ht->param(files=>[sort { $a->{title} cmp $b->{title} } @files], prefix => $prefix, json => $json); print $ht->output; } @@ -142,8 +146,10 @@ $default_template = <<'HTML'; TitleArtistAlbumGenreTrackYearType -/ +/ + + HTML 1;