mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
+ code to pupulate publisher list in the content manager
This commit is contained in:
@ -345,6 +345,22 @@ namespace kiwix {
|
||||
return booksLanguages;
|
||||
}
|
||||
|
||||
vector<string> Manager::getBooksPublishers() {
|
||||
std::vector<string> booksPublishers;
|
||||
std::vector<kiwix::Book>::iterator itr;
|
||||
std::map<string, bool> booksPublishersMap;
|
||||
|
||||
std::sort(library.books.begin(), library.books.end(), kiwix::Book::sortByPublisher);
|
||||
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||
if (booksPublishersMap.find(itr->creator) == booksPublishersMap.end()) {
|
||||
booksPublishersMap[itr->creator] = true;
|
||||
booksPublishers.push_back(itr->creator);
|
||||
}
|
||||
}
|
||||
|
||||
return booksPublishers;
|
||||
}
|
||||
|
||||
kiwix::Library Manager::cloneLibrary() {
|
||||
return this->library;
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ namespace kiwix {
|
||||
void removeBookPaths();
|
||||
bool listBooks(const supportedListMode mode, const supportedListSortBy sortBy, const unsigned int maxSize);
|
||||
vector<string> getBooksLanguages();
|
||||
vector<string> getBooksPublishers();
|
||||
|
||||
string writableLibraryPath;
|
||||
|
||||
|
Reference in New Issue
Block a user