mirror of
https://github.com/PaiGramTeam/EnkaNetwork.py.git
synced 2024-09-28 03:26:09 +00:00
Fix "avatarId" and "reliquarySubstats" not founded
This commit is contained in:
parent
bb78e8aa7c
commit
a36ca4ad5f
@ -59,7 +59,7 @@ class EquipmentsDetail(BaseModel):
|
||||
__pydantic_self__.icon = Assets.create_icon_path(data["icon"])
|
||||
__pydantic_self__.artifact_type = EquipType(data["equipType"]).name
|
||||
# Sub Stats
|
||||
for stats in data["reliquarySubstats"]:
|
||||
for stats in data["reliquarySubstats"] if "reliquarySubstats" in data else []:
|
||||
__pydantic_self__.substats.append(
|
||||
EquipmentsStats.parse_obj(stats))
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import logging
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import List, Any
|
||||
from typing import List, Any, Union
|
||||
|
||||
from ..assets import Assets
|
||||
|
||||
@ -17,13 +17,14 @@ class ProfilePicture(BaseModel):
|
||||
"""
|
||||
Custom add data
|
||||
"""
|
||||
url: str = ""
|
||||
url: Union[str, None] = None
|
||||
|
||||
def __init__(__pydantic_self__, **data: Any) -> None:
|
||||
super().__init__(**data)
|
||||
|
||||
# Get character
|
||||
LOGGER.debug("=== Avatar ===")
|
||||
if "avatarId" in data:
|
||||
icon = Assets.character_icon(str(data["avatarId"]))
|
||||
|
||||
if not icon:
|
||||
|
Loading…
Reference in New Issue
Block a user