Merge pull request #179 from kiwix/fix_library

Fix library
This commit is contained in:
Matthieu Gautier 2018-11-12 12:21:54 +01:00 committed by GitHub
commit be6f96adc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -87,7 +87,7 @@ void Book::update(const kiwix::Reader& reader)
m_origId = reader.getOrigId();
m_articleCount = reader.getArticleCount();
m_mediaCount = reader.getMediaCount();
m_size = reader.getFileSize() << 10;
m_size = static_cast<uint64_t>(reader.getFileSize()) << 10;
reader.getFavicon(m_favicon, m_faviconMimeType);
}

View File

@ -145,10 +145,10 @@ bool Library::writeToFile(const std::string& path) {
bookNode.append_attribute("url") = book.getUrl().c_str();
}
if (!book.getArticleCount())
if (book.getArticleCount())
bookNode.append_attribute("articleCount") = to_string(book.getArticleCount()).c_str();
if (!book.getMediaCount())
if (book.getMediaCount())
bookNode.append_attribute("mediaCount") = to_string(book.getMediaCount()).c_str();
if (book.getSize()) {

View File

@ -851,7 +851,7 @@ bool Reader::isCorrupted() const
unsigned int Reader::getFileSize() const
{
zim::File* file = this->getZimFileHandler();
zim::offset_type size = 0;
zim::size_type size = 0;
if (file != NULL) {
size = file->getFilesize();