X-Git-Url: http://git.ieval.ro/?p=app-musicexpo.git;a=blobdiff_plain;f=lib%2FApp%2FMusicExpo.pm;fp=lib%2FApp%2FMusicExpo.pm;h=cf16468be168d69498b4ead9bec69d2a2b308925;hp=7cdf6e29441f15fdf2493d1e893c8e966aeb66e6;hb=a5dd5c0dee4a02197fe6e9bc36424d2befdfb816;hpb=e659895fb7970472cf756b91ac6f9f63979c4b05 diff --git a/lib/App/MusicExpo.pm b/lib/App/MusicExpo.pm index 7cdf6e2..cf16468 100644 --- a/lib/App/MusicExpo.pm +++ b/lib/App/MusicExpo.pm @@ -1,5 +1,5 @@ package App::MusicExpo; -use v5.14; +use 5.014000; use strict; use warnings; @@ -29,9 +29,9 @@ our $cache=''; our $template=''; GetOptions ( - "template:s" => \$template, - "prefix:s" => \$prefix, - "cache:s" => \$cache, + 'template:s' => \$template, + 'prefix:s' => \$prefix, + 'cache:s' => \$cache, ); sub flacinfo{ @@ -54,7 +54,7 @@ sub flacinfo{ sub mp3info{ my $file=$_[0]; my %tag = map { encode 'UTF-8', $_ } %{get_mp3tag $file}; - my @trkn = split '/', $tag{TRACKNUM} // ''; + my @trkn = split m#/#s, $tag{TRACKNUM} // ''; freeze +{ format => 'MP3', @@ -86,7 +86,7 @@ sub vorbisinfo{ } } -sub mp4_format ($){ +sub mp4_format ($){ ## no critic (ProhibitSubroutinePrototypes) my $encoding = $_[0]; return 'AAC' if $encoding eq 'mp4a'; return 'ALAC' if $encoding eq 'alac'; @@ -128,9 +128,8 @@ sub normalizer{ sub make_fragment{ join '-', map { lc =~ y/a-z0-9/_/csr } @_ } sub run { - my %info = %info; if ($cache) { - tie my %cache, 'DB_File', $cache, O_RDWR|O_CREAT, 0644; + tie my %cache, 'DB_File', $cache, O_RDWR|O_CREAT, 0644; ## no critic (ProhibitTie) $info{$_} = memoize $info{$_}, INSTALL => undef, NORMALIZER => \&normalizer, LIST_CACHE => 'FAULT', SCALAR_CACHE => [HASH => \%cache] for keys %info; } @@ -164,7 +163,7 @@ sub run { @files = sort { $a->{title} cmp $b->{title} } @files; $ht->param(files => \@files, prefix => $prefix); - print $ht->output; + print $ht->output; ## no critic (RequireCheckedSyscalls) } $default_template = <<'HTML';