mirror of https://github.com/kiwix/libkiwix.git
+ fix the generation of the lastopen list of files
This commit is contained in:
parent
aadce46adf
commit
e33b448380
|
@ -452,33 +452,36 @@ namespace kiwix {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Special sort for LASTOPEN */
|
/* Special sort for LASTOPEN */
|
||||||
if (mode == LASTOPEN)
|
if (mode == LASTOPEN) {
|
||||||
std::sort(library.books.begin(), library.books.end(), kiwix::Book::sortByLastOpen);
|
std::sort(library.books.begin(), library.books.end(), kiwix::Book::sortByLastOpen);
|
||||||
|
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||||
|
if (!itr->last.empty())
|
||||||
|
this->bookIdList.push_back(itr->id);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* Generate the list of book id */
|
||||||
|
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
/* Generate the list of book id */
|
if (mode == LOCAL && itr->path.empty())
|
||||||
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
ok = false;
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
if (mode == LOCAL && itr->path.empty())
|
if (ok == true && mode == REMOTE && (!itr->path.empty() || itr->url.empty()))
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
if (mode == REMOTE && (!itr->path.empty() || itr->url.empty()))
|
if (ok == true && atoi(itr->size.c_str()) > maxSize * 1024 * 1024)
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
if (mode == LASTOPEN && itr->last.empty())
|
if (ok == true && !language.empty() && itr->language != language)
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
if (atoi(itr->size.c_str()) > maxSize * 1024 * 1024)
|
if (ok == true && !publisher.empty() && itr->creator != publisher)
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
if (!language.empty() && itr->language != language)
|
if (ok == true) {
|
||||||
ok = false;
|
this->bookIdList.push_back(itr->id);
|
||||||
|
}
|
||||||
if (!publisher.empty() && itr->creator != publisher)
|
}
|
||||||
ok = false;
|
|
||||||
|
|
||||||
if (ok == true)
|
|
||||||
this->bookIdList.push_back(itr->id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue