fix: Fix cover thumbnail pipeline for home screen

Remove empty sentinel BMP file from generateThumbBmp() that blocked
placeholder generation for books without covers. Add removeBook() to
RecentBooksStore and clear book from recents on cache delete. Ensure
home screen always generates placeholder when thumbnail generation fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cottongin
2026-02-15 19:53:52 -05:00
parent 19004eefaa
commit 66f703df69
5 changed files with 16 additions and 5 deletions

View File

@@ -88,7 +88,7 @@ void HomeActivity::loadRecentCovers(int coverHeight) {
}
// Fallback: generate a placeholder thumbnail with title/author
if (!success && !Storage.exists(coverPath.c_str())) {
if (!success) {
const int thumbWidth = static_cast<int>(coverHeight * 0.6);
PlaceholderCoverGenerator::generate(coverPath, book.title, book.author, thumbWidth, coverHeight);
}

View File

@@ -745,6 +745,9 @@ void EpubReaderActivity::onReaderMenuConfirm(EpubReaderMenuActivity::MenuAction
epub->setupCacheDir();
saveProgress(backupSpine, backupPage, backupPageCount);
// 5. Remove from recent books so the home screen doesn't show a stale/placeholder cover
RECENT_BOOKS.removeBook(epub->getPath());
}
xSemaphoreGive(renderingMutex);
// Defer go home to avoid race condition with display task