Code cleanup: standardized imports, refined formatting for consistency, and resolved minor redundancies in services, models, monitoring, and tools modules.
This commit is contained in:
parent
e486d78e31
commit
ec0fe38861
39 changed files with 222 additions and 239 deletions
|
|
@ -7,6 +7,7 @@ from typing import Optional
|
|||
@dataclass
|
||||
class DailyChallenge:
|
||||
"""Daily challenge information."""
|
||||
|
||||
token: str
|
||||
map_name: str = ""
|
||||
date: str = ""
|
||||
|
|
@ -20,7 +21,9 @@ class DailyChallenge:
|
|||
"""Create DailyChallenge from API response."""
|
||||
return cls(
|
||||
token=data.get("token", data.get("challengeToken", "")),
|
||||
map_name=data.get("map", {}).get("name", "") if isinstance(data.get("map"), dict) else "",
|
||||
map_name=(
|
||||
data.get("map", {}).get("name", "") if isinstance(data.get("map"), dict) else ""
|
||||
),
|
||||
date=data.get("date", data.get("day", "")),
|
||||
time_limit=data.get("timeLimit", 0),
|
||||
completed=data.get("completed", data.get("played", False)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue