game search download WIP

searchDownload
Thibault Duplessis 2021-08-05 15:41:55 +02:00
parent a766f67734
commit 4dab7b9cb3
1 changed files with 3 additions and 2 deletions

View File

@ -40,11 +40,12 @@ final class GameSearchApi(
}
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)
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