fix: equipment field is category (not type), re-fetched data

This commit is contained in:
Cupcake 2026-06-03 18:23:30 +00:00
parent f6858e6ea1
commit 0327a088f1
4 changed files with 261 additions and 206 deletions

View file

@ -142,10 +142,11 @@ def simplify_magic_item(m: dict) -> dict:
def simplify_item(i: dict) -> dict:
"""Extract key fields from equipment/item."""
cat = i.get("category") or {}
return {
"key": i.get("key", ""),
"name": i.get("name", ""),
"type": i.get("type", {}).get("name") if isinstance(i.get("type"), dict) else i.get("type"),
"category": cat.get("name") if isinstance(cat, dict) else cat,
"cost": i.get("cost", ""),
"weight": i.get("weight", ""),
"description": i.get("desc", ""),