ongoing games cannot be exported

because the current state of ongoing games is protected

see this endpoint instead:
https://lichess.org/api#operation/apiUserCurrentGame

requires changing #9180
pull/9206/head
Thibault Duplessis 2021-06-15 16:27:14 +02:00
parent ae7af3e966
commit 2bdaa990f2
2 changed files with 1 additions and 4 deletions

View File

@ -89,7 +89,6 @@ final class Game(
perfType = (~get("perfType", req) split "," flatMap { lila.rating.PerfType(_) }).toSet,
color = get("color", req) flatMap chess.Color.fromName,
analysed = getBoolOpt("analysed", req),
ongoing = getBool("ongoing", req),
flags = requestPgnFlags(req, extended = false).copy(literate = false),
perSecond = MaxPerSecond(me match {
case Some(m) if m is user.id => 60

View File

@ -112,8 +112,7 @@ final class GameApiV2(
gameRepo
.sortedCursor(
config.vs.fold(Query.user(config.user.id)) { Query.opponents(config.user, _) } ++
Query.createdBetween(config.since, config.until) ++
(!config.ongoing).??(Query.finished),
Query.createdBetween(config.since, config.until) ++ Query.finished,
Query.sortCreated,
batchSize = config.perSecond.value
)
@ -354,7 +353,6 @@ object GameApiV2 {
rated: Option[Boolean] = None,
perfType: Set[lila.rating.PerfType],
analysed: Option[Boolean] = None,
ongoing: Boolean = false,
color: Option[chess.Color],
flags: WithFlags,
perSecond: MaxPerSecond,