File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -242,16 +242,21 @@ private final class RelayPlayerApi(
242242 .flatMapz: tour =>
243243 for
244244 players <- readGamesAndPlayers(sg.toList)
245- withScore = if tour.showScores then computeScores(players) else players
246- withRatingDiff <-
247- if tour.showRatingDiffs then computeRatingDiffs(withScore)
248- else fuccess(withScore)
249- withTiebreaks <- tour.tiebreaks.fold(fuccess(withRatingDiff)): tiebreaks =>
250- roundRepo
251- .idsByTourOrdered(sg.last)
252- .map(_.lastOption)
253- .map(computeTiebreaks(withRatingDiff, tiebreaks, _))
254- yield withTiebreaks
245+ atLeastOneGameFinished = players.exists(_._2.games.exists(_.points.isDefined))
246+ result <-
247+ if ! atLeastOneGameFinished then fuccess(players)
248+ else
249+ val withScore = if tour.showScores then computeScores(players) else players
250+ for
251+ withRatingDiff <-
252+ if tour.showRatingDiffs then computeRatingDiffs(withScore) else fuccess(withScore)
253+ withTiebreaks <- tour.tiebreaks.fold(fuccess(withRatingDiff)): tiebreaks =>
254+ roundRepo
255+ .idsByTourOrdered(sg.last)
256+ .map(_.lastOption)
257+ .map(computeTiebreaks(withRatingDiff, tiebreaks, _))
258+ yield withTiebreaks
259+ yield result
255260
256261 private def sgIsParallel (tours : List [RelayTour ]): Boolean =
257262 tours.headOption
You can’t perform that action at this time.
0 commit comments