From 9d6d04a4bf7fc26eb7ea4361c8c726ad24106871 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 25 Oct 2014 15:08:23 +0300 Subject: [PATCH] Use tags from all versions instead of only the first --- lib/App/MusicExpo.pm | 8 +++++++- t/musicexpo-cache.t | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) 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'; -- 2.30.2