X-Git-Url: http://git.ieval.ro/?p=app-musicexpo.git;a=blobdiff_plain;f=lib%2FApp%2FMusicExpo.pm;h=c38d2b7f7b22ff56e6e884ab94be428f233f76a4;hp=4ff61baaa9d548494a75433d87f74aa21522f796;hb=447902f92b2e16faaa6116f8b6c43ea46d044d71;hpb=a06c3a2b63b4589efad35aebfbbe32d53e8f3d13 diff --git a/lib/App/MusicExpo.pm b/lib/App/MusicExpo.pm index 4ff61ba..c38d2b7 100644 --- a/lib/App/MusicExpo.pm +++ b/lib/App/MusicExpo.pm @@ -123,6 +123,8 @@ sub normalizer{ "$_[0]|".(stat $_[0])[9] } +sub make_fragment{ join '-', map { lc =~ y/a-z0-9/_/csr } @_ } + sub run { if ($cache) { tie my %cache, 'DB_File', $cache, O_RDWR|O_CREAT, 0644; @@ -159,6 +161,7 @@ sub run { } } delete $entry{$_} for qw/format file/; + $entry{fragment} = make_fragment @entry{qw/artist title/}; push @files, \%entry } @@ -180,7 +183,7 @@ $default_template = <<'HTML'; TitleArtistAlbumGenreTrackYearType -/ +/ HTML