also export ongoing games in /api/games/user
parent
2d0e6df79a
commit
1001dd6800
|
@ -96,7 +96,8 @@ final class Game(
|
|||
case Some(_) if oauth => 30 // bonus for oauth logged in only (not for CSRF)
|
||||
case _ => 20
|
||||
}),
|
||||
playerFile = get("players", req)
|
||||
playerFile = get("players", req),
|
||||
ongoing = getBool("ongoing", req)
|
||||
)
|
||||
val date = DateTimeFormat forPattern "yyyy-MM-dd" print new DateTime
|
||||
apiC
|
||||
|
|
|
@ -113,7 +113,9 @@ final class GameApiV2(
|
|||
gameRepo
|
||||
.sortedCursor(
|
||||
config.vs.fold(Query.user(config.user.id)) { Query.opponents(config.user, _) } ++
|
||||
Query.createdBetween(config.since, config.until) ++ Query.finished,
|
||||
Query.createdBetween(config.since, config.until) ++ {
|
||||
!config.ongoing ?? Query.finished
|
||||
},
|
||||
config.sort.bson,
|
||||
batchSize = config.perSecond.value
|
||||
)
|
||||
|
@ -364,7 +366,8 @@ object GameApiV2 {
|
|||
flags: WithFlags,
|
||||
sort: GameSort,
|
||||
perSecond: MaxPerSecond,
|
||||
playerFile: Option[String]
|
||||
playerFile: Option[String],
|
||||
ongoing: Boolean = false
|
||||
) extends Config {
|
||||
def postFilter(g: Game) =
|
||||
rated.fold(true)(g.rated ==) && {
|
||||
|
|
Loading…
Reference in New Issue