mirror of
https://github.com/thekiwismarthome/shopping-list-manager.git
synced 2026-05-01 11:46:30 +00:00
Merge pull request #3 from thekiwismarthome/v2.0.4---Lots-of-Enhancements
V2.0.4 - Bug Fixes and New Features
This commit is contained in:
@@ -460,6 +460,9 @@ class ShoppingListStorage:
|
|||||||
)
|
)
|
||||||
self._products[new_product.id] = new_product
|
self._products[new_product.id] = new_product
|
||||||
await self._save_products()
|
await self._save_products()
|
||||||
|
# Rebuild search engine so the new product is immediately searchable
|
||||||
|
products_dict = {pid: p.to_dict() for pid, p in self._products.items()}
|
||||||
|
self._search_engine = ProductSearch(products_dict)
|
||||||
_LOGGER.debug("Added product: %s", new_product.name)
|
_LOGGER.debug("Added product: %s", new_product.name)
|
||||||
return new_product
|
return new_product
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ async def ws_get_products_by_ids(
|
|||||||
product_ids = set(msg["product_ids"])
|
product_ids = set(msg["product_ids"])
|
||||||
|
|
||||||
# Get all products from storage
|
# Get all products from storage
|
||||||
all_products = storage.get_all_products()
|
all_products = storage.get_products()
|
||||||
|
|
||||||
products = [
|
products = [
|
||||||
product.to_dict()
|
product.to_dict()
|
||||||
|
|||||||
Reference in New Issue
Block a user