feat: add BookManager utility and RecentBooksStore::clear()

BookManager provides static functions for archive/unarchive/delete/
deleteCache/reindex operations on books, centralizing cache path
computation and file operations. Archive preserves directory structure
under /.archive/ and renames cache dirs to match new path hashes.

RecentBooksStore: :clear() added for bulk cache clearing use case.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cottongin
2026-02-21 02:52:38 -05:00
parent 3eddb07a1a
commit 29954a3683
4 changed files with 267 additions and 0 deletions

View File

@@ -47,6 +47,11 @@ void RecentBooksStore::removeBook(const std::string& path) {
}
}
void RecentBooksStore::clear() {
recentBooks.clear();
saveToFile();
}
void RecentBooksStore::updateBook(const std::string& path, const std::string& title, const std::string& author,
const std::string& coverBmpPath) {
auto it =