X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FMusicExpo.pm;h=ee8a8f54b64d9613a5cf785a4b0037574d2ba774;hb=b67c2762b65efca590eb4d7c6eab9b8578d1e821;hp=967e9f4013c95de29ca97e54db6bfa91f20140e2;hpb=6a1f7df933501d8b892e6f38528e1aa804130c6f;p=app-musicexpo.git diff --git a/lib/App/MusicExpo.pm b/lib/App/MusicExpo.pm index 967e9f4..ee8a8f5 100644 --- a/lib/App/MusicExpo.pm +++ b/lib/App/MusicExpo.pm @@ -3,7 +3,7 @@ use v5.14; use strict; use warnings; -our $VERSION = 0.003001; +our $VERSION = '0.003003'; use Audio::FLAC::Header qw//; use HTML::Template::Compiled qw//; @@ -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::MaybeXS; use Storable qw/thaw freeze/; ################################################## @@ -26,9 +27,9 @@ our $cache=''; our $template=''; GetOptions ( - "template=s" => \$template, - "prefix=s" => \$prefix, - "cache=s" => \$cache, + "template:s" => \$template, + "prefix:s" => \$prefix, + "cache:s" => \$cache, ); @@ -128,7 +129,10 @@ sub run { push @files, \%entry } - $ht->param(files=>[sort { $a->{title} cmp $b->{title} } @files], prefix => $prefix); + my $json = JSON::MaybeXS->new(canonical => 1)->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,14 +146,18 @@ $default_template = <<'HTML'; TitleArtistAlbumGenreTrackYearType -/ +/ + + HTML 1; __END__ +=encoding utf-8 + =head1 NAME App::MusicExpo - script which generates a HTML table of music tags @@ -198,7 +206,7 @@ Marius Gavrilescu, Emarius@ieval.roE =head1 COPYRIGHT AND LICENSE -Copyright (C) 2013 by Marius Gavrilescu +Copyright (C) 2013-2014 by Marius Gavrilescu This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or,