mirror of
https://github.com/thekiwismarthome/shopping-list-manager.git
synced 2026-05-01 11:46:30 +00:00
Update storage.py
This commit is contained in:
@@ -141,6 +141,14 @@ class ShoppingListStorage:
|
|||||||
await self._save_products()
|
await self._save_products()
|
||||||
_LOGGER.info("Successfully imported %d products from catalog", len(self._products))
|
_LOGGER.info("Successfully imported %d products from catalog", len(self._products))
|
||||||
|
|
||||||
|
# Initialize search engine after products are loaded
|
||||||
|
if self._products:
|
||||||
|
products_dict = {pid: p.to_dict() for pid, p in self._products.items()}
|
||||||
|
self._search_engine = ProductSearch(products_dict)
|
||||||
|
_LOGGER.debug("Initialized product search engine with %d products", len(self._products))
|
||||||
|
else:
|
||||||
|
self._search_engine = None
|
||||||
|
_LOGGER.warning("No products loaded, search engine not initialized")
|
||||||
|
|
||||||
# Lists methods
|
# Lists methods
|
||||||
async def _save_lists(self) -> None:
|
async def _save_lists(self) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user