PaiGramTeam / SIMNet

Modern API wrapper for Genshin Impact & Honkai: Star Rail built on asyncio and pydantic.
MIT License
14 stars 0 forks source link

[bug]: get_record_cards should ignore games that cannot be converted #41

Closed omg-xtao closed 1 year ago

omg-xtao commented 1 year ago

What is expected?

get_record_cards get_record_card return right data.

File

https://github.com/PaiGramTeam/SIMNet/blob/15c7228e2c104d3698a579f73e24eac21e6be768/simnet/models/lab/record.py#L423

Additional info

4 - 未定事件簿

Traceback (most recent call last):
  File "D:\Program\jb\apps\PyCharm-P\ch-0\231.9011.38\plugins\python\helpers\pydev\pydevconsole.py", line 367, in runcode
    loop.run_until_complete(coro)
  File "d:\program files\python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "<input>", line 1, in <module>
  File "D:\git\SIMNet\simnet\client\components\chronicle\base.py", line 125, in get_record_cards
    return [RecordCard(**card) for card in data["list"]]
  File "D:\git\SIMNet\simnet\client\components\chronicle\base.py", line 125, in <listcomp>
    return [RecordCard(**card) for card in data["list"]]
  File "D:\git\SIMNet\simnet\models\lab\record.py", line 423, in __new__
    raise ValueError(f"Invalid game ID provided: {game_id}")
ValueError: Invalid game ID provided: 4