🐛 Fix starrail challenge model

This commit is contained in:
xtaodada 2023-12-30 10:01:36 +08:00
parent 77834cf750
commit 338f5367a0
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
3 changed files with 6 additions and 10 deletions

View File

@ -78,8 +78,8 @@ class BaseClient(AsyncContextManager["BaseClient"]):
self.client = AsyncClient(cookies=cookies, timeout=timeout)
self.region = region
self.lang = lang
self.device_id = device_id
self.device_fp = device_fp
self.device_id = device_id or cookies.get("x-rpc-device_id", None)
self.device_fp = device_fp or cookies.get("x-rpc-device_fp", None)
@property
def cookies(self) -> Cookies:

View File

@ -19,12 +19,6 @@ class StarRailPartialCharacter(StarRailBaseCharacter):
rank: int
class FloorCharacter(StarRailBaseCharacter):
"""Character in a floor."""
level: int
class RogueCharacter(StarRailBaseCharacter):
"""Rogue character model."""

View File

@ -4,7 +4,7 @@ from typing import List
from pydantic import Field
from simnet.models.base import APIModel
from simnet.models.starrail.character import FloorCharacter
from simnet.models.starrail.character import RogueCharacter
from .base import PartialTime
@ -15,7 +15,7 @@ class FloorNode(APIModel):
"""Node for a floor."""
challenge_time: PartialTime
avatars: List[FloorCharacter]
avatars: List[RogueCharacter]
class StarRailFloor(APIModel):
@ -27,6 +27,8 @@ class StarRailFloor(APIModel):
node_1: FloorNode
node_2: FloorNode
is_chaos: bool
is_fast: bool
maze_id: int
class StarRailChallenge(APIModel):