mirror of
https://github.com/kiwix/libkiwix.git
synced 2026-10-22 17:15:18 -04:00
/catalog/search?count=0 returns all entries
This commit is contained in:
1 parent
08c3a9d8b2
commit
b8328a78f6
2 files changed
+6
-2
No files matched your search
@@ -720,7 +720,8 @@ InternalServer::search_catalog(const RequestContext& request,
|
||||
const auto totalResults = bookIdsToDump.size();
|
||||
const size_t count = request.get_optional_param("count", 10UL);
|
||||
const size_t startIndex = request.get_optional_param("start", 0UL);
|
||||
bookIdsToDump = subrange(bookIdsToDump, startIndex, count);
|
||||
const size_t intendedCount = count > 0 ? count : bookIdsToDump.size();
|
||||
bookIdsToDump = subrange(bookIdsToDump, startIndex, intendedCount);
|
||||
opdsDumper.setOpenSearchInfo(totalResults, startIndex, bookIdsToDump.size());
|
||||
return bookIdsToDump;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user