refactor: unify book cache clearing for epub, txt, and xtc files (#1875)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "MappedInputManager.h"
|
||||
#include "components/UITheme.h"
|
||||
#include "fontIds.h"
|
||||
#include "util/BookCacheUtils.h"
|
||||
|
||||
void ClearCacheActivity::onEnter() {
|
||||
Activity::onEnter();
|
||||
@@ -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_"))) {
|
||||
// Only delete directories matching known book cache names.
|
||||
if (file.isDirectory() && isBookCacheDirectoryName(itemName.c_str())) {
|
||||
String fullPath = "/.crosspoint/" + itemName;
|
||||
LOG_DBG("CLEAR_CACHE", "Removing cache: %s", fullPath.c_str());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user