Fix bug with selectin epubs inside of folders

This commit is contained in:
Dave Allie 2025-12-06 12:57:17 +11:00
parent 9a33030623
commit 6d3d25a288
No known key found for this signature in database
GPG Key ID: F2FDDB3AD8D0276F
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

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