+ kiwix-manage is not able anymore to add ZIM file without title || date || language metadata

This commit is contained in:
kelson42 2011-07-21 12:13:44 +00:00
parent 86dae55c18
commit a2e4ecc9f5
2 changed files with 9 additions and 5 deletions

View File

@ -188,13 +188,17 @@ namespace kiwix {
return library.current;
}
bool Manager::addBookFromPath(const string path, const string url) {
bool Manager::addBookFromPath(const string path, const string url, const bool checkMetaData) {
kiwix::Book book;
if (this->readBookFromPath(path, book)) {
book.url = url;
library.addBook(book);
return true;
if (!checkMetaData ||
checkMetaData && !book.title.empty() && !book.language.empty() && !book.date.empty()) {
book.url = url;
library.addBook(book);
return true;
}
}
return false;

View File

@ -55,7 +55,7 @@ namespace kiwix {
bool setBookIndex(const string id, const string path, const supportedIndexType type);
bool setBookPath(const string id, const string path);
string getCurrentBookId();
bool addBookFromPath(const string path, const string url = "");
bool addBookFromPath(const string path, const string url = "", const bool checkMetaData = false);
Library cloneLibrary();
bool getBookById(const string id, Book &book);
bool updateBookLastOpenDateById(const string id);