From 27248b197d8dc0c9583d198269df787cc06e3d19 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Sun, 23 Mar 2025 16:50:56 +0800 Subject: [PATCH] Update cache management in ApiRoutes to remove hash index by file path - Added functionality to update the hash index by removing entries associated with the specified file path during cache management. - Ensured that the cache is properly resorted after the removal of raw data items. --- py/routes/api_routes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py/routes/api_routes.py b/py/routes/api_routes.py index ab4feace..10a52a78 100644 --- a/py/routes/api_routes.py +++ b/py/routes/api_routes.py @@ -269,6 +269,9 @@ class ApiRoutes: cache = await self.scanner.get_cached_data() cache.raw_data = [item for item in cache.raw_data if item['file_path'] != main_path] await cache.resort() + + # update hash index + self.scanner._hash_index.remove_by_path(main_path) # Delete optional files for pattern in patterns[1:]: