From: Marius Gavrilescu Date: Sat, 25 Oct 2014 12:08:23 +0000 (+0300) Subject: Use tags from all versions instead of only the first X-Git-Tag: 0.004~2 X-Git-Url: http://git.ieval.ro/?p=app-musicexpo.git;a=commitdiff_plain;h=9d6d04a4bf7fc26eb7ea4361c8c726ad24106871 Use tags from all versions instead of only the first --- diff --git a/lib/App/MusicExpo.pm b/lib/App/MusicExpo.pm index ebee6ef..a6c21a5 100644 --- a/lib/App/MusicExpo.pm +++ b/lib/App/MusicExpo.pm @@ -153,7 +153,13 @@ sub run { for (values %files) { my @versions = @$_; my %entry = (%{$versions[0]}, formats => []); - push $entry{formats}, {format => $_->{format}, file => $_->{file}} for @versions; + for my $ver (@versions) { + push $entry{formats}, {format => $ver->{format}, file => $ver->{file}}; + for my $key (keys $ver) { + $entry{$key} = $ver->{$key} if $ver->{$key} ne '?'; + } + } + delete $entry{$_} for qw/format file/; push @files, \%entry } diff --git a/t/musicexpo-cache.t b/t/musicexpo-cache.t index ac4afc4..70972a1 100644 --- a/t/musicexpo-cache.t +++ b/t/musicexpo-cache.t @@ -35,7 +35,7 @@ is $out, <<'OUT', 'output is correct'; CelluleSilenceL'autre endroitElectro01/092005FLAC MP3 - + OUT ok -e $file, 'cache exists';