fix: equipment field is category (not type), re-fetched data
This commit is contained in:
parent
f6858e6ea1
commit
0327a088f1
4 changed files with 261 additions and 206 deletions
|
|
@ -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", ""),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue