feat: port crossink 'read book move' feature to crosspoint (#2032)

This commit is contained in:
KemoNine
2026-05-18 12:39:50 -04:00
committed by GitHub
parent 8a11f44571
commit 06d28d6ffa
28 changed files with 130 additions and 1 deletions
+14
View File
@@ -56,6 +56,20 @@ void RecentBooksStore::updateBook(const std::string& path, const std::string& ti
}
}
void RecentBooksStore::updatePath(const std::string& oldPath, const std::string& newPath,
const std::string& oldCachePath, const std::string& newCachePath) {
auto it = std::find_if(recentBooks.begin(), recentBooks.end(),
[&](const RecentBook& book) { return book.path == oldPath; });
if (it == recentBooks.end()) {
return;
}
it->path = newPath;
if (!oldCachePath.empty() && !it->coverBmpPath.empty() && it->coverBmpPath.rfind(oldCachePath, 0) == 0) {
it->coverBmpPath = newCachePath + it->coverBmpPath.substr(oldCachePath.size());
}
saveToFile();
}
bool RecentBooksStore::isMissing(const RecentBook& book) { return !Storage.exists(book.path.c_str()); }
bool RecentBooksStore::pruneMissing() {