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:
Matthieu Gautier 2018-10-16 19:43:34 +02:00
parent fe6d5fa93e
commit a73ef23f6e
2 changed files with 3 additions and 3 deletions

View File

@ -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 {

View File

@ -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()) {