From 30b4b26c9ea1d1f2ac9066ad463c02e272edf4ae Mon Sep 17 00:00:00 2001 From: C <0xicl33n@gmail.com> Date: Sun, 4 Jan 2026 11:56:27 -0800 Subject: [PATCH] CATEGORY ID IS NONE?????? --- src/asquare.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/asquare.py b/src/asquare.py index 1b74efd..ce79d1d 100644 --- a/src/asquare.py +++ b/src/asquare.py @@ -167,11 +167,21 @@ async def get_item_by_variation_id(variation_id: str) -> dict: print( f"[@DEBUG] Found parent item: {obj['id']} on page {page_count}" ) + + # Since we searched by category, we know it's in LEGO_CAT_ID + # But also try to get from item_data as fallback + category_id = item_data.get("category_id") or LEGO_CAT_ID + + print( + f"[@DEBUG] Item category_id from data: {item_data.get('category_id')}" + ) + print(f"[@DEBUG] Using category_id: {category_id}") + return { "id": obj["id"], "name": item_data.get("name", ""), "description": item_data.get("description", ""), - "category_id": item_data.get("category_id"), + "category_id": category_id, "variations": variations, "updated_at": obj.get("updated_at"), "version": obj.get("version"),