mirror of https://github.com/kiwix/libkiwix.git
Merge branch 'master' of ssh://git.code.sf.net/p/kiwix/kiwix
This commit is contained in:
commit
ac50d0eade
|
@ -254,12 +254,6 @@ namespace kiwix {
|
||||||
book.creator = reader->getCreator();
|
book.creator = reader->getCreator();
|
||||||
book.publisher = reader->getPublisher();
|
book.publisher = reader->getPublisher();
|
||||||
book.title = reader->getTitle();
|
book.title = reader->getTitle();
|
||||||
if (book.title.empty()) {
|
|
||||||
book.title = getLastPathElement(path);
|
|
||||||
std::replace(book.title.begin(), book.title.end(), '_', ' ');
|
|
||||||
size_t pos = book.title.find(".zim");
|
|
||||||
book.title = book.title.substr(0, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostringstream articleCountStream;
|
std::ostringstream articleCountStream;
|
||||||
articleCountStream << reader->getArticleCount();
|
articleCountStream << reader->getArticleCount();
|
||||||
|
|
|
@ -245,6 +245,12 @@ namespace kiwix {
|
||||||
string Reader::getTitle() {
|
string Reader::getTitle() {
|
||||||
string value;
|
string value;
|
||||||
this->getMetatag("Title", value);
|
this->getMetatag("Title", value);
|
||||||
|
if (value.empty()) {
|
||||||
|
value = getLastPathElement(zimFileHandler->getFilename());
|
||||||
|
std::replace(value.begin(), value.end(), '_', ' ');
|
||||||
|
size_t pos = value.find(".zim");
|
||||||
|
value = value.substr(0, pos);
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue