mirror of https://github.com/kiwix/libkiwix.git
Keep the book size in byte in memory (instead of in kb)
We keep the size in kb in library.xml for compatibility.
This commit is contained in:
parent
fe6d5fa93e
commit
a73ef23f6e
|
@ -120,7 +120,7 @@ void Book::updateFromXml(const pugi::xml_node& node, const std::string& baseDir)
|
|||
m_origId = ATTR("origId");
|
||||
m_articleCount = strtoull(ATTR("articleCount"), 0, 0);
|
||||
m_mediaCount = strtoull(ATTR("mediaCount"), 0, 0);
|
||||
m_size = strtoull(ATTR("size"), 0, 0);
|
||||
m_size = strtoull(ATTR("size"), 0, 0) << 10;
|
||||
m_favicon = base64_decode(ATTR("favicon"));
|
||||
m_faviconMimeType = ATTR("faviconMimeType");
|
||||
try {
|
||||
|
|
|
@ -152,8 +152,8 @@ bool Library::writeToFile(const std::string& path) {
|
|||
if (!book.getMediaCount())
|
||||
bookNode.append_attribute("mediaCount") = to_string(book.getMediaCount()).c_str();
|
||||
|
||||
if (!book.getSize()) {
|
||||
bookNode.append_attribute("size") = to_string(book.getSize()).c_str();
|
||||
if (book.getSize()) {
|
||||
bookNode.append_attribute("size") = to_string(book.getSize()>>10).c_str();
|
||||
}
|
||||
|
||||
if (!book.getDownloadId().empty()) {
|
||||
|
|
Loading…
Reference in New Issue