Languages OPDS feed includes book counts

This commit is contained in:
Veloman Yunkan
2021-07-08 17:00:54 +04:00
committed by Matthieu Gautier
parent 45adda44b3
commit ab3095745e
5 changed files with 34 additions and 5 deletions

View File

@ -154,6 +154,7 @@ class Library
public:
typedef std::vector<std::string> BookIdCollection;
typedef std::map<std::string, int> AttributeCounts;
public:
Library();
@ -242,6 +243,13 @@ class Library
*/
std::vector<std::string> getBooksLanguages() const;
/**
* Get all languagues of the books in the library with counts.
*
* @return A list of languages with the count of books in each language.
*/
AttributeCounts getBooksLanguagesWithCounts() const;
/**
* Get all categories of the books in the library.
*
@ -345,6 +353,7 @@ private: // types
typedef const std::string& (Book::*BookStrPropMemFn)() const;
private: // functions
AttributeCounts getBookAttributeCounts(BookStrPropMemFn p) const;
std::vector<std::string> getBookPropValueSet(BookStrPropMemFn p) const;
BookIdCollection filterViaBookDB(const Filter& filter) const;
void updateBookDB(const Book& book);