X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=html%2Fshow-tournament.pl;h=b204270422048e58ee57d461c324df362a509efb;hp=8d6dc45009d8bf8ce86652cf7fd1bb9253f1a958;hb=27e59286fabcd68735d8601b232a954015da812e;hpb=c6d4beb429904725988d107ddab644a52d217aab diff --git a/html/show-tournament.pl b/html/show-tournament.pl index 8d6dc45..b204270 100755 --- a/html/show-tournament.pl +++ b/html/show-tournament.pl @@ -30,7 +30,7 @@ for my $score (@$scores) { my $p = $rounds[$#rounds]->{'parallels'}; if ($score->{'parallel'} != $parallel) { $parallel = $score->{'parallel'}; - push @$p, { parallel => $parallel, players => [], songs => [] }; + push @$p, { parallel => $parallel, players => [], songs => [], num_songs => 0 }; $player = ''; # Information on songs is not selected from roundrandomsongs etc., @@ -43,12 +43,13 @@ for my $score (@$scores) { } else { push @{$p->[$#$p]->{'songs'}}, $score->{'title'}; } + $p->[$#$p]->{'num_songs'}++; } my $pl = $p->[$#$p]->{'players'}; if ($score->{'nick'} ne $player) { $player = $score->{'nick'}; - push @$pl, { nick => $player, songs => [] }; + push @$pl, { nick => $player, songs => [], total => 0 }; } @@ -57,6 +58,7 @@ for my $score (@$scores) { chosen => $score->{'chosen'}, score => $score->{'score'} }; + $pl->[$#$pl]->{'total'} += $score->{'score'}; } ccbs::print_header();