test(benchmark): mark some books as read for on deck

This commit is contained in:
Gauthier Roebroeck 2024-09-06 16:16:21 +08:00
parent bf8bbdd764
commit 0047a91a18
2 changed files with 12 additions and 0 deletions

View file

@ -36,6 +36,16 @@ class DashboardBenchmark : AbstractRestBenchmark() {
}
}
// mark some books read for on deck
bookController.getBooksOnDeck(principal, page = Pageable.ofSize(DEFAULT_PAGE_SIZE)).let { page ->
if (page.totalElements < DEFAULT_PAGE_SIZE) {
seriesController.getAllSeries(principal, readStatus = listOf(ReadStatus.UNREAD), oneshot = false, page = Pageable.ofSize(DEFAULT_PAGE_SIZE)).content.forEach { series ->
val book = seriesController.getAllBooksBySeries(principal, series.id, page = Pageable.ofSize(1)).content.first()
bookController.markReadProgress(book.id, ReadProgressUpdateDto(null, true), principal)
}
}
}
// retrieve most recent book release date
bookLatestReleaseDate = bookController.getAllBooks(principal, page = PageRequest.of(0, 1, Sort.by(Sort.Order.desc("metadata.releaseDate"))))
.content.firstOrNull()?.metadata?.releaseDate ?: LocalDate.now()

View file

@ -16,6 +16,8 @@ komga:
file: \${komga.config-dir}/\${komga.workspace}.sqlite
lucene:
data-directory: \${komga.config-dir}/lucene/\${komga.workspace}
tasks-db:
file: \${komga.config-dir}/\${komga.workspace}-tasks.sqlite
spring:
flyway:
enabled: true