From 36a77e34b95e3c2319dfbfb1af3b8acd48f630ac Mon Sep 17 00:00:00 2001 From: Jonas Diemer Date: Tue, 30 Dec 2025 12:50:20 +0100 Subject: [PATCH] Bump cache version. --- lib/Epub/Epub/BookMetadataCache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Epub/Epub/BookMetadataCache.cpp b/lib/Epub/Epub/BookMetadataCache.cpp index 7dcd0529..06b4f458 100644 --- a/lib/Epub/Epub/BookMetadataCache.cpp +++ b/lib/Epub/Epub/BookMetadataCache.cpp @@ -9,7 +9,7 @@ #include "FsHelpers.h" namespace { -constexpr uint8_t BOOK_CACHE_VERSION = 2; +constexpr uint8_t BOOK_CACHE_VERSION = 3; constexpr char bookBinFile[] = "/book.bin"; constexpr char tmpSpineBinFile[] = "/spine.bin.tmp"; constexpr char tmpTocBinFile[] = "/toc.bin.tmp"; @@ -87,8 +87,8 @@ bool BookMetadataCache::buildBookBin(const std::string& epubPath, const BookMeta constexpr uint32_t headerASize = sizeof(BOOK_CACHE_VERSION) + /* LUT Offset */ sizeof(uint32_t) + sizeof(spineCount) + sizeof(tocCount); - const uint32_t metadataSize = - metadata.title.size() + metadata.author.size() + metadata.coverItemHref.size() + metadata.textReferenceHref.size() + sizeof(uint32_t) * 4; + const uint32_t metadataSize = metadata.title.size() + metadata.author.size() + metadata.coverItemHref.size() + + metadata.textReferenceHref.size() + sizeof(uint32_t) * 4; const uint32_t lutSize = sizeof(uint32_t) * spineCount + sizeof(uint32_t) * tocCount; const uint32_t lutOffset = headerASize + metadataSize;