X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Ftop5chosenscreen.cpp;h=cbb445511b51cf49dd32fec87274472d7f6ff69f;hp=3110684cf66ea637b43a12f8aa76b3d54ba3accd;hb=5b91be5c8efa7c68e38134630c9894dd6484d72e;hpb=723136532e3bb8b318b595b9eeef031275d5c72e diff --git a/bigscreen/top5chosenscreen.cpp b/bigscreen/top5chosenscreen.cpp index 3110684..cbb4455 100644 --- a/bigscreen/top5chosenscreen.cpp +++ b/bigscreen/top5chosenscreen.cpp @@ -20,7 +20,17 @@ bool Top5ChosenScreen::check_invalidated() if (!scores_changed.get_flag()) return false; - return true; + // check that there are indeed changes, otherwise don't bother + std::vector scores; + conn.perform(FetchTopChosenSongsForTournament(tournament, 5, &scores)); + + for (std::vector::const_iterator i = scores.begin(); i != scores.end(); ++i) { + if (seen_topchosen.count(*i) == 0) { + return true; + } + } + + return false; } void Top5ChosenScreen::draw(unsigned char *buf) @@ -63,7 +73,7 @@ void Top5ChosenScreen::draw(unsigned char *buf) std::sprintf(str, "%u", i->frequency); width = my_draw_text(str, NULL, 24.0); - my_draw_text(str, buf, 24.0, 728 - width/2, y, r, g, b); + my_draw_text(str, buf, 24.0, 745 - width/2, y, r, g, b); y += 40; }