Skip to content

Commit

Permalink
add import.date optional field to game export endpoint - closes #16050
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 19, 2024
1 parent 3568d7d commit 6fb46d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/api/src/main/GameApiV2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ final class GameApiV2(
.add("lastMove" -> flags.lastFen.option(g.lastMoveKeys))
.add("division" -> flags.division.option(division(g, initialFen)))
.add("bookmarked" -> bookmarked)
.add("import" -> g.pgnImport.map: i =>
Json.obj().add("date" -> i.date))

private def gameLightUsers(game: Game): Future[ByColor[(lila.core.game.Player, Option[LightUser])]] =
game.players.traverse(_.userId.so(getLightUser)).dmap(game.players.zip(_))
Expand Down

0 comments on commit 6fb46d4

Please sign in to comment.