mirror of
https://github.com/gotson/komga.git
synced 2025-12-21 16:03:03 +01:00
fix(api): exception on unpaged empty content
This commit is contained in:
parent
4ed35d2764
commit
2cc27f244c
2 changed files with 3 additions and 3 deletions
|
|
@ -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()
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue