fix user perfs list

This commit is contained in:
Thibault Duplessis 2017-04-04 13:30:32 +02:00
parent d3dfdfea13
commit 587ce2e9e0
3 changed files with 4 additions and 4 deletions

View file

@ -53,6 +53,8 @@ case class Hook(
def username = user.fold(User.anonymous)(_.username)
def lame = user ?? (_.lame)
lazy val perfType = PerfPicker.perfType(speed, realVariant, none)
lazy val perf: Option[LobbyPerf] = for { u <- user; pt <- perfType } yield u perfAt pt
def rating: Option[Int] = perf.map(_.rating)
@ -70,8 +72,6 @@ case class Hook(
.add("c" -> chess.Color(color).map(_.name))
.add("perf" -> perfType.map(_.name))
lazy val perfType = PerfPicker.perfType(speed, realVariant, none)
def randomColor = color == "random"
lazy val compatibleWithPools =

View file

@ -30,7 +30,7 @@ private[lobby] object LobbyUser {
private def perfMapOf(perfs: lila.user.Perfs): PerfMap =
perfs.perfs.collect {
case (key, perf) if key != "puzzle" && perf.nonEmpty =>
case (key, perf) if key != PerfType.Puzzle.key && perf.nonEmpty =>
key -> LobbyPerf(perf.intRating, perf.provisional)
}(scala.collection.breakOut)
}

View file

@ -34,7 +34,7 @@ case class Perfs(
"horde" -> horde,
"racingKings" -> racingKings,
"crazyhouse" -> crazyhouse,
"ultraBullet" -> bullet,
"ultraBullet" -> ultraBullet,
"bullet" -> bullet,
"blitz" -> blitz,
"classical" -> classical,