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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user