simplify per-game table: tracked player only, no rating diff column
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 31s
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 31s
Reworked the per-game row layout to be relative to the tracked player instead of white/black: the tracked player's name+accuracy+rating are always shown first, the opponent's rating+accuracy (no name) always second, regardless of which color each side played in a given game - this keeps columns aligned across rows even as the tracked player switches sides. Dropped the rating-change-per-game column added earlier; it pushed the line past mobile width limits.
This commit is contained in:
parent
d479e14bf9
commit
26cb066515
3 changed files with 29 additions and 39 deletions
|
|
@ -163,7 +163,6 @@ class GameRow(BaseModel):
|
|||
result: str = Field(..., description="Результат партии: '1-0', '0-1' или '1/2-1/2'")
|
||||
created_at: int = Field(..., description="Время создания партии (Unix timestamp в миллисекундах)")
|
||||
tracked_is_white: Optional[bool] = Field(None, description="True, если отслеживаемый пользователь играл белыми; False — чёрными; None — не удалось определить сторону")
|
||||
tracked_rating_diff: Optional[int] = Field(None, description="Изменение рейтинга отслеживаемого пользователя по итогам этой партии")
|
||||
|
||||
class GameStats(BaseModel):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -583,13 +583,6 @@ class StatsService:
|
|||
else:
|
||||
tracked_is_white = None
|
||||
|
||||
if tracked_is_white is True:
|
||||
tracked_rating_diff = white.get('ratingDiff')
|
||||
elif tracked_is_white is False:
|
||||
tracked_rating_diff = black.get('ratingDiff')
|
||||
else:
|
||||
tracked_rating_diff = None
|
||||
|
||||
return GameRow(
|
||||
white_name=white_name,
|
||||
black_name=black_name,
|
||||
|
|
@ -599,8 +592,7 @@ class StatsService:
|
|||
black_accuracy=(black.get('analysis') or {}).get('accuracy'),
|
||||
result=result,
|
||||
created_at=game.get('createdAt', 0),
|
||||
tracked_is_white=tracked_is_white,
|
||||
tracked_rating_diff=tracked_rating_diff
|
||||
tracked_is_white=tracked_is_white
|
||||
)
|
||||
|
||||
def _process_games_of_period(self, games: List[Dict[str, Any]], username: str, include_games: bool = False) -> GamesOfPeriodStats:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue