fix tournament featured game

This commit is contained in:
Thibault Duplessis 2016-01-26 12:00:57 +07:00
parent 4137bab139
commit 59827b33ee

View file

@ -88,7 +88,7 @@ private[tournament] final class TournamentApi(
RankedPairing(ranking) map (_.flatten) flatMap { curOption =>
val candidates = pairings flatMap RankedPairing(ranking)
if (curOption.exists(_.pairing.playing)) funit
else candidates.sortBy(-_.bestRank).headOption ?? { best =>
else candidates.sortBy(_.bestRank).headOption ?? { best =>
TournamentRepo.setFeaturedGameId(tour.id, best.pairing.gameId)
}
}