game search download WIP
parent
a766f67734
commit
4dab7b9cb3
|
@ -40,11 +40,12 @@ final class GameSearchApi(
|
||||||
}
|
}
|
||||||
|
|
||||||
def source(query: Query, nb: Int): Source[Game, _] = {
|
def source(query: Query, nb: Int): Source[Game, _] = {
|
||||||
val perPage = config.MaxPerPage(50)
|
val perPage = config.MaxPerPage(50)
|
||||||
val lastPage = math.ceil(nb.toFloat / perPage.value) atLeast 1 atMost (1000 / perPage.value)
|
val lastPage = math.ceil(nb.toFloat / perPage.value) atLeast 1 atMost (1000 / perPage.value)
|
||||||
Source.unfoldAsync(1) { page =>
|
Source.unfoldAsync(1) { page =>
|
||||||
search(query
|
search(query, From((page - 1) * perPage.value), Size(perPage.value))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private def storable(game: Game) = game.finished || game.imported
|
private def storable(game: Game) = game.finished || game.imported
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue