From 3cc127d658b2ea9c3c48313dfe61bdcc99bd2203 Mon Sep 17 00:00:00 2001 From: cottongin Date: Sat, 21 Feb 2026 03:05:19 -0500 Subject: [PATCH] fix: ClearCacheActivity now clears txt_* caches and recents list Add txt_* prefix to the directory check so TXT book caches are also removed. After clearing all cache directories, call RECENT_BOOKS.clear() to remove stale entries that would show missing covers on the home screen. Co-authored-by: Cursor --- src/activities/settings/ClearCacheActivity.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/activities/settings/ClearCacheActivity.cpp b/src/activities/settings/ClearCacheActivity.cpp index b07758d0..bce3950a 100644 --- a/src/activities/settings/ClearCacheActivity.cpp +++ b/src/activities/settings/ClearCacheActivity.cpp @@ -6,6 +6,7 @@ #include #include "MappedInputManager.h" +#include "RecentBooksStore.h" #include "components/UITheme.h" #include "fontIds.h" @@ -94,8 +95,8 @@ void ClearCacheActivity::clearCache() { file.getName(name, sizeof(name)); String itemName(name); - // Only delete directories starting with epub_ or xtc_ - if (file.isDirectory() && (itemName.startsWith("epub_") || itemName.startsWith("xtc_"))) { + if (file.isDirectory() && + (itemName.startsWith("epub_") || itemName.startsWith("xtc_") || itemName.startsWith("txt_"))) { String fullPath = "/.crosspoint/" + itemName; LOG_DBG("CLEAR_CACHE", "Removing cache: %s", fullPath.c_str()); @@ -113,6 +114,9 @@ void ClearCacheActivity::clearCache() { } root.close(); + // Clear recents since all cached data (covers, progress) is gone + RECENT_BOOKS.clear(); + LOG_DBG("CLEAR_CACHE", "Cache cleared: %d removed, %d failed", clearedCount, failedCount); state = SUCCESS;