fix: add txt books to recent tab (#526)

Cherry-picked from upstream PR #526
Resolved conflict: kept local cover generation code
This commit is contained in:
cottongin 2026-01-27 07:32:40 -05:00
parent 31199f9dd1
commit d8b8c5bad9
No known key found for this signature in database
GPG Key ID: 0ECC91FE4655C262

View File

@ -11,6 +11,7 @@
#include "CrossPointSettings.h" #include "CrossPointSettings.h"
#include "CrossPointState.h" #include "CrossPointState.h"
#include "MappedInputManager.h" #include "MappedInputManager.h"
#include "RecentBooksStore.h"
#include "ScreenComponents.h" #include "ScreenComponents.h"
#include "fontIds.h" #include "fontIds.h"
@ -103,11 +104,12 @@ void TxtReaderActivity::onEnter() {
}); });
} }
// Save current txt as last opened file and cache title for home screen // Save current txt as last opened file and add to recent books
APP_STATE.openEpubPath = txt->getPath(); APP_STATE.openEpubPath = txt->getPath();
APP_STATE.openBookTitle = txt->getTitle(); APP_STATE.openBookTitle = txt->getTitle();
APP_STATE.openBookAuthor.clear(); // TXT files don't have author metadata APP_STATE.openBookAuthor.clear(); // TXT files don't have author metadata
APP_STATE.saveToFile(); APP_STATE.saveToFile();
RECENT_BOOKS.addBook(txt->getPath());
// Trigger first update // Trigger first update
updateRequired = true; updateRequired = true;