mirror of https://github.com/kiwix/libkiwix.git
+ kiwix-manage is not able anymore to add ZIM file without title || date || language metadata
This commit is contained in:
parent
86dae55c18
commit
a2e4ecc9f5
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue