filter exported games by perf type
This commit is contained in:
parent
7289b53eca
commit
524e384839
|
@ -44,6 +44,7 @@ object Game extends LilaController {
|
|||
until = getLong("until", req) map { ts => new DateTime(ts) },
|
||||
max = getInt("max", req) map (_ atLeast 1),
|
||||
rated = getBoolOpt("rated", req),
|
||||
perfType = get("perfType", req) flatMap lila.rating.PerfType.apply,
|
||||
flags = lila.game.PgnDump.WithFlags(
|
||||
moves = getBoolOpt("moves", req) | true,
|
||||
tags = getBoolOpt("tags", req) | true,
|
||||
|
|
|
@ -63,9 +63,12 @@ object PgnDump {
|
|||
until: Option[DateTime] = None,
|
||||
max: Option[Int] = None,
|
||||
rated: Option[Boolean] = None,
|
||||
perfType: Option[lila.rating.PerfType],
|
||||
flags: WithFlags,
|
||||
perSecond: MaxPerSecond
|
||||
) {
|
||||
def postFilter(g: Game) = rated.fold(true)(g.rated ==)
|
||||
def postFilter(g: Game) =
|
||||
rated.fold(true)(g.rated ==) &&
|
||||
perfType.fold(true)(g.perfType.has)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue