Skip to content

Commit

Permalink
feat: Add rank_percent field to DeadlyAssault
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Dec 22, 2024
1 parent 7ef86ed commit 4091c88
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions genshin/models/zzz/chronicle/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ class DeadlyAssault(APIModel):
has_data: bool
total_score: int
total_star: int
rank_percent: str

nickname: str = Aliased("nick_name")
player_avatar: str = Aliased("avatar_icon")
Expand All @@ -213,3 +214,7 @@ def __parse_datetime(cls, value: typing.Mapping[str, typing.Any]) -> typing.Opti
if value:
return datetime.datetime(**value)
return None

@pydantic.field_validator("rank_percent", mode="before")
def __parse_rank_percent(cls, value: int) -> str:
return f"{value/100}%"

0 comments on commit 4091c88

Please sign in to comment.