X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=html%2Fshow-tournament.pl;fp=html%2Fshow-tournament.pl;h=602e5cb1696c1230f36fc457dbe3091666ea3c4e;hp=3d0db3c945f38c8bb363b93362b30d20637e329e;hb=9e9a178da172bb8cacb39b308eb965cd6f23a40c;hpb=3200c9792d41a6a7a5edea7747fd613fae609798 diff --git a/html/show-tournament.pl b/html/show-tournament.pl index 3d0db3c..602e5cb 100755 --- a/html/show-tournament.pl +++ b/html/show-tournament.pl @@ -24,6 +24,9 @@ if ($ref->{'num_incomplete'} == 0) { $closing_valid = 0; } +# Find all rounds currently shown on the bigscreen. +my $active_rounds = $dbh->selectall_hashref('SELECT round FROM bigscreen.active_rounds WHERE tournament=?', 'round', undef, $id); + # Swoop all the data in in a big join, then order it over to quasi-sane Perl objects. # (round -> parallel -> player -> songs -> title,chosen,score) my $scores = ccbs::db_fetch_all($dbh, @@ -38,6 +41,12 @@ for my $score (@$scores) { $round = $score->{'round'}; push @rounds, { round => $round, parallels => [], locked => 0 }; $parallel = -1; + + if (defined($active_rounds->{$round})) { + $rounds[$#rounds]->{'bigscreen'} = 1; + } else { + $rounds[$#rounds]->{'bigscreen'} = 0; + } } my $p = $rounds[$#rounds]->{'parallels'}; if ($score->{'parallel'} != $parallel) {