X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bigscreen%2Ffetch_max_score_for_player.cpp;h=f63a582d832c4af49607e62bdbc12a6d5d4d58a6;hb=57c939a53665f808b2429461d547271adf2c5908;hp=70472b07821dfaa79376cbe6394a24667f8f3010;hpb=76518bb5379322ff9015d8cb4eb019724b31c8ec;p=ccbs diff --git a/bigscreen/fetch_max_score_for_player.cpp b/bigscreen/fetch_max_score_for_player.cpp index 70472b0..f63a582 100644 --- a/bigscreen/fetch_max_score_for_player.cpp +++ b/bigscreen/fetch_max_score_for_player.cpp @@ -7,8 +7,8 @@ void FetchMaxScoreForPlayer::operator() (pqxx::transaction<> &t) { pqxx::result res( t.exec("SELECT MAX(feetrating)*1000 AS max_score FROM songratings WHERE " "machine=( SELECT machine FROM tournaments WHERE tournament=" + pqxx::to_string(tournament) + ") AND " - "(song NOT IN ( SELECT song FROM scores WHERE tournament=" + pqxx::to_string(tournament) + " AND song IS NOT NULL AND ( " - "round=" + pqxx::to_string(round) + " OR parallel=0 OR ( player=" + pqxx::to_string(player) + " AND chosen='t' ) ) ) )") ); + "song NOT IN ( SELECT song FROM scores WHERE tournament=" + pqxx::to_string(tournament) + " AND song IS NOT NULL AND ( " + "parallel=0 OR ( player=" + pqxx::to_string(player) + " AND ( chosen='t' OR round=" + pqxx::to_string(round) + " ) ) ) )") ); *score = res.at(0)["max_score"].as(*score); }