mirror of
https://github.com/gotson/komga.git
synced 2026-05-09 05:10:19 +02: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(
|
return PageImpl(
|
||||||
items,
|
items,
|
||||||
if (pageable.isPaged) PageRequest.of(pageable.pageNumber, pageable.pageSize, pageSort)
|
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()
|
count.toLong()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -95,7 +95,7 @@ class SeriesCollectionDao(
|
||||||
return PageImpl(
|
return PageImpl(
|
||||||
items,
|
items,
|
||||||
if (pageable.isPaged) PageRequest.of(pageable.pageNumber, pageable.pageSize, pageSort)
|
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()
|
count.toLong()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ class SeriesDtoDao(
|
||||||
return PageImpl(
|
return PageImpl(
|
||||||
dtos,
|
dtos,
|
||||||
if (pageable.isPaged) PageRequest.of(pageable.pageNumber, pageable.pageSize, pageSort)
|
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()
|
count.toLong()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue