+ 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,14 +188,18 @@ namespace kiwix {
return library.current; 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; kiwix::Book book;
if (this->readBookFromPath(path, book)) { if (this->readBookFromPath(path, book)) {
if (!checkMetaData ||
checkMetaData && !book.title.empty() && !book.language.empty() && !book.date.empty()) {
book.url = url; book.url = url;
library.addBook(book); library.addBook(book);
return true; return true;
} }
}
return false; return false;
} }

View File

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