diff --git a/include/manager.h b/include/manager.h index 0e980b341..718bfb3a0 100644 --- a/include/manager.h +++ b/include/manager.h @@ -196,7 +196,10 @@ class Manager std::string writableLibraryPath; - std::vector bookIdList; + bool m_hasSearchResult = false; + uint64_t m_totalBooks = 0; + uint64_t m_startIndex = 0; + uint64_t m_itemsPerPage = 0; protected: kiwix::LibraryManipulator* manipulator; diff --git a/src/manager.cpp b/src/manager.cpp index 582d8ec49..4fb0637e2 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -95,6 +95,15 @@ bool Manager::parseOpdsDom(const pugi::xml_document& doc, const std::string& url { pugi::xml_node libraryNode = doc.child("feed"); + try { + m_totalBooks = strtoull(libraryNode.child("totalResults").child_value(), 0, 0); + m_startIndex = strtoull(libraryNode.child("startIndex").child_value(), 0, 0); + m_itemsPerPage = strtoull(libraryNode.child("itemsPerPage").child_value(), 0, 0); + m_hasSearchResult = true; + } catch(...) { + m_hasSearchResult = false; + } + for (pugi::xml_node entryNode = libraryNode.child("entry"); entryNode; entryNode = entryNode.next_sibling("entry")) { kiwix::Book book;