Skip to content

Commit

Permalink
🐛 Fix genshin img theater buff desc
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Jul 29, 2024
1 parent d27e6e9 commit 0ddc9da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions simnet/client/components/chronicle/genshin.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,23 @@ async def get_genshin_imaginarium_theater(
player_id: Optional[int] = None,
need_detail: Optional[bool] = True,
*,
previous: bool = False,
lang: Optional[str] = None,
) -> ImgTheater:
"""Get genshin imaginarium theater runs.
Args:
player_id (Optional[int], optional): The player ID. Defaults to None.
need_detail (Optional[bool], optional): Whether to retrieve detailed data. Defaults to True.
previous (bool, optional): Whether to retrieve the data for the previous season of the Imaginarium Theater.
lang (Optional[str], optional): The language of the data. Defaults to None.
Returns:
ImgTheater: genshin imaginarium theater runs.
"""
payload = {
"need_detail": need_detail,
"schedule_type": 2 if previous else 1,
}
data = await self._request_genshin_record("role_combat", player_id, lang=lang, payload=payload)

Expand Down
5 changes: 5 additions & 0 deletions simnet/models/genshin/chronicle/img_theater.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from simnet.models.base import APIModel
from simnet.models.genshin.character import BaseCharacter
from simnet.models.starrail.chronicle.base import PartialTime
from simnet.models.zzz.calculator import desc_to_html


class TheaterCharaType(enum.IntEnum):
Expand Down Expand Up @@ -44,6 +45,10 @@ class TheaterBuff(APIModel):
is_enhanced: bool
id: int

@property
def desc_html(self) -> str:
return desc_to_html(self.desc)


class Act(APIModel):
"""One act in the theater."""
Expand Down

0 comments on commit 0ddc9da

Please sign in to comment.