diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesCollectionDao.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesCollectionDao.kt index eb611156d..9815428ff 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesCollectionDao.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesCollectionDao.kt @@ -65,7 +65,7 @@ class SeriesCollectionDao( return PageImpl( items, if (pageable.isPaged) PageRequest.of(pageable.pageNumber, pageable.pageSize, pageSort) - else PageRequest.of(0, count.toInt(), pageSort), + else PageRequest.of(0, maxOf(count.toInt(), 20), pageSort), count.toLong() ) } @@ -95,7 +95,7 @@ class SeriesCollectionDao( return PageImpl( items, if (pageable.isPaged) PageRequest.of(pageable.pageNumber, pageable.pageSize, pageSort) - else PageRequest.of(0, count.toInt(), pageSort), + else PageRequest.of(0, maxOf(count, 20), pageSort), count.toLong() ) } diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesDtoDao.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesDtoDao.kt index 5d8a3a819..7bade1092 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesDtoDao.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesDtoDao.kt @@ -132,7 +132,7 @@ class SeriesDtoDao( return PageImpl( dtos, if (pageable.isPaged) PageRequest.of(pageable.pageNumber, pageable.pageSize, pageSort) - else PageRequest.of(0, count.toInt(), pageSort), + else PageRequest.of(0, maxOf(count, 20), pageSort), count.toLong() ) }