From d608fb98488d2095ae1b2930904ea6d75ccdd441 Mon Sep 17 00:00:00 2001 From: Dave Allie Date: Tue, 30 Dec 2025 15:58:34 +1100 Subject: [PATCH] Make sections directory if it does not exist --- lib/Epub/Epub/Section.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Epub/Epub/Section.cpp b/lib/Epub/Epub/Section.cpp index 45512c1..b153f4f 100644 --- a/lib/Epub/Epub/Section.cpp +++ b/lib/Epub/Epub/Section.cpp @@ -115,6 +115,12 @@ bool Section::createSectionFile(const int fontId, const float lineCompression, c const auto localPath = epub->getSpineItem(spineIndex).href; const auto tmpHtmlPath = epub->getCachePath() + "/.tmp_" + std::to_string(spineIndex) + ".html"; + // Create cache directory if it doesn't exist + { + const auto sectionsDir = epub->getCachePath() + "/sections"; + SdMan.mkdir(sectionsDir.c_str()); + } + // Retry logic for SD card timing issues bool success = false; uint32_t fileSize = 0;