From 6d3d25a28824849beb37cc410660966a627de00f Mon Sep 17 00:00:00 2001 From: Dave Allie Date: Sat, 6 Dec 2025 12:57:17 +1100 Subject: [PATCH] Fix bug with selectin epubs inside of folders --- src/main.cpp | 2 +- src/screens/FileSelectionScreen.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ba04a99..071662f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -43,7 +43,7 @@ constexpr unsigned long POWER_BUTTON_SLEEP_MS = 1000; Epub* loadEpub(const std::string& path) { if (!SD.exists(path.c_str())) { - Serial.println("File does not exist"); + Serial.printf("File does not exist: %s\n", path.c_str()); return nullptr; } diff --git a/src/screens/FileSelectionScreen.cpp b/src/screens/FileSelectionScreen.cpp index 1e5637a..bb73006 100644 --- a/src/screens/FileSelectionScreen.cpp +++ b/src/screens/FileSelectionScreen.cpp @@ -70,8 +70,8 @@ void FileSelectionScreen::handleInput() { return; } + if (basepath.back() != '/') basepath += "/"; if (files[selectorIndex].back() == '/') { - if (basepath.back() != '/') basepath += "/"; basepath += files[selectorIndex].substr(0, files[selectorIndex].length() - 1); loadFiles(); updateRequired = true;