fix(api): fix remaining lowercase fields in NexusWeapon

This commit is contained in:
LemonNexus 2026-02-09 14:07:44 +00:00
parent 27c3e5ad6e
commit a903a65275
1 changed files with 5 additions and 5 deletions

View File

@ -51,14 +51,14 @@ class NexusWeapon(NexusItem):
@classmethod @classmethod
def from_api(cls, data: Dict[str, Any]) -> "NexusWeapon": def from_api(cls, data: Dict[str, Any]) -> "NexusWeapon":
"""Create from API response.""" """Create from API response."""
props = data.get('properties', {}) props = data.get('Properties', {})
economy = props.get('Economy', {}) economy = props.get('Economy', {})
damage = props.get('Damage', {}) damage = props.get('Damage', {})
return cls( return cls(
id=data.get('id', 0), id=data.get('Id', 0),
name=data.get('name', 'Unknown'), name=data.get('Name', 'Unknown'),
item_id=str(data.get('id', 0)), item_id=str(data.get('Id', 0)),
category='weapon', category='weapon',
damage=Decimal(str(damage.get('Total', 0))), damage=Decimal(str(damage.get('Total', 0))),
decay=Decimal(str(economy.get('Decay', 0))), decay=Decimal(str(economy.get('Decay', 0))),
@ -68,7 +68,7 @@ class NexusWeapon(NexusItem):
cost_per_hour=Decimal(str(economy.get('CostPerHour', 0))), cost_per_hour=Decimal(str(economy.get('CostPerHour', 0))),
efficiency=Decimal(str(props.get('Efficiency', 0))), efficiency=Decimal(str(props.get('Efficiency', 0))),
range_val=Decimal(str(props.get('Range', 0))), range_val=Decimal(str(props.get('Range', 0))),
type=data.get('type', ''), type=props.get('Type', ''),
) )