Brings ~55 mod-exclusive files to the upstream-based mod/master-resync branch: Activities (migrated to new ActivityManager pattern): - Clock/Time: SetTimeActivity, SetTimezoneOffsetActivity, NtpSyncActivity - Dictionary: DictionaryDefinitionActivity, DictionarySuggestionsActivity, DictionaryWordSelectActivity, LookedUpWordsActivity - Bookmark: EpubReaderBookmarkSelectionActivity - Book management: BookManageMenuActivity, EndOfBookMenuActivity - OPDS: OpdsServerListActivity, OpdsSettingsActivity - Utility: DirectoryPickerActivity, NumericStepperActivity Utilities (unchanged): - BookManager, BookSettings, BookmarkStore, BootNtpSync - Dictionary, LookupHistory, TimeSync, OpdsServerStore Libraries: PlaceholderCover, TableData, ChapterXPathIndexer Scripts: inject_mod_version, generate_book_icon, preview_placeholder_cover Docs: KOReader sync XPath mapping Migration changes: - ActivityWithSubactivity -> Activity base class - Callback constructors -> finish()/setResult() pattern - enterNewActivity() -> startActivityForResult() - Activity::RenderLock&& -> RenderLock&& These files won't compile yet - they reference mod settings and I18n strings that will be added in subsequent phases. Made-with: Cursor
1.7 KiB
1.7 KiB
Fix: Cover/Thumbnail Pipeline on Home Screen
Date: 2026-02-15
Task Description
Multiple issues with book cover thumbnails on the home screen:
- After clearing a book's cache, the home screen showed a placeholder instead of the real cover.
- Books without covers showed blank rectangles instead of generated placeholder covers.
Root Cause
Epub::generateThumbBmp() wrote an empty 0-byte BMP file as a "don't retry" sentinel when a book had no cover. This empty file:
- Blocked the placeholder fallback in
EpubReaderActivity::onEnter()(file exists check passes) - Tricked the home screen into thinking a valid thumbnail exists (skips regeneration)
- Failed to parse in
LyraTheme::drawRecentBookCover()resulting in a blank gray rectangle
Changes Made
lib/Epub/Epub.cpp: Removed the empty sentinel file write fromgenerateThumbBmp(). Now it simply returnsfalsewhen there's no cover, letting callers generate valid placeholder BMPs that serve the same "don't retry" purpose.src/activities/home/HomeActivity.cpp: Changed placeholder fallback inloadRecentCovers()fromif (!success && !Storage.exists(coverPath))toif (!success)as defense-in-depth for edge cases like global cache clear.src/RecentBooksStore.h: AddedremoveBook(const std::string& path)method declaration.src/RecentBooksStore.cpp: ImplementedremoveBook()— finds and erases the book by path, then persists the updated list.src/activities/reader/EpubReaderActivity.cpp: After clearing cache in theDELETE_CACHEhandler, callsRECENT_BOOKS.removeBook(epub->getPath())so the book is cleanly removed from recents when its cache is wiped.
Follow-up Items
- None.