mirror of https://github.com/kiwix/libkiwix.git
Updated kiwix::manager class to prevent it from returning a diff file as a normal book.
This commit is contained in:
parent
7fd2dce1fa
commit
7fbf20936e
|
@ -316,10 +316,12 @@ namespace kiwix {
|
|||
std::sort(library.books.begin(), library.books.end(), kiwix::Book::sortByLanguage);
|
||||
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||
if (booksLanguagesMap.find(itr->language) == booksLanguagesMap.end()) {
|
||||
if(itr->origID=="") {
|
||||
booksLanguagesMap[itr->language] = true;
|
||||
booksLanguages.push_back(itr->language);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return booksLanguages;
|
||||
}
|
||||
|
@ -332,10 +334,12 @@ namespace kiwix {
|
|||
std::sort(library.books.begin(), library.books.end(), kiwix::Book::sortByCreator);
|
||||
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||
if (booksCreatorsMap.find(itr->creator) == booksCreatorsMap.end()) {
|
||||
if(itr->origID=="") {
|
||||
booksCreatorsMap[itr->creator] = true;
|
||||
booksCreators.push_back(itr->creator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return booksCreators;
|
||||
}
|
||||
|
@ -346,8 +350,10 @@ namespace kiwix {
|
|||
std::vector<kiwix::Book>::iterator itr;
|
||||
|
||||
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||
if(itr->origID=="") {
|
||||
booksIds.push_back(itr->id);
|
||||
}
|
||||
}
|
||||
|
||||
return booksIds;
|
||||
}
|
||||
|
@ -360,10 +366,12 @@ namespace kiwix {
|
|||
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->publisher) == booksPublishersMap.end()) {
|
||||
if(itr->origID=="") {
|
||||
booksPublishersMap[itr->publisher] = true;
|
||||
booksPublishers.push_back(itr->publisher);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return booksPublishers;
|
||||
}
|
||||
|
@ -386,10 +394,12 @@ namespace kiwix {
|
|||
std::vector<kiwix::Book>::iterator itr;
|
||||
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||
if ( itr->id == id) {
|
||||
if(itr->origID=="") {
|
||||
book = *itr;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue