diff --git a/lib/Epub/Epub.cpp b/lib/Epub/Epub.cpp index 42024a5..3b75453 100644 --- a/lib/Epub/Epub.cpp +++ b/lib/Epub/Epub.cpp @@ -414,6 +414,7 @@ int Epub::findVirtualSpineIndex(const std::string& filename) const { } return -1; } + size_t Epub::getBookSize() const { return getCumulativeSpineItemSize(getSpineItemsCount() - 1); } // Calculate progress in book @@ -423,4 +424,4 @@ uint8_t Epub::calculateProgress(const int currentSpineIndex, const float current size_t bookSize = getBookSize(); size_t sectionProgSize = currentSpineRead * curChapterSize; return round(static_cast(prevChapterSize + sectionProgSize) / bookSize * 100.0); -} +} \ No newline at end of file diff --git a/src/activities/reader/EpubReaderActivity.cpp b/src/activities/reader/EpubReaderActivity.cpp index de5c838..636dc84 100644 --- a/src/activities/reader/EpubReaderActivity.cpp +++ b/src/activities/reader/EpubReaderActivity.cpp @@ -46,13 +46,14 @@ void EpubReaderActivity::onEnter() { nextPageNumber = data[2] + (data[3] << 8); Serial.printf("[%lu] [ERS] Loaded cache: %d, %d\n", millis(), currentSpineIndex, nextPageNumber); f.close(); + f.close(); } // Trigger first update updateRequired = true; xTaskCreate(&EpubReaderActivity::taskTrampoline, "EpubReaderActivityTask", - 8192, // Stack size + 24576, // Stack size this, // Parameters 1, // Priority &displayTaskHandle // Task handle