bug fixed 1000 games
This commit is contained in:
parent
3226d4c162
commit
3e61fa33c4
4 changed files with 29 additions and 22 deletions
|
|
@ -606,6 +606,15 @@ class StatsService:
|
|||
|
||||
# Обрабатываем игры
|
||||
games_stats = self._process_games_of_period(games, username)
|
||||
# Определяем время самой старой партии (в секундах)
|
||||
earliest_game_ts = None
|
||||
try:
|
||||
if games:
|
||||
earliest_game_ts = min(g.get('createdAt', 0) for g in games if isinstance(g.get('createdAt', None), int))
|
||||
if earliest_game_ts:
|
||||
earliest_game_ts = earliest_game_ts // 1000
|
||||
except Exception:
|
||||
earliest_game_ts = None
|
||||
|
||||
return GamesOfPeriodResponse(
|
||||
message="Статистика игр за период",
|
||||
|
|
@ -613,6 +622,7 @@ class StatsService:
|
|||
period_start=since_timestamp,
|
||||
period_end=until_timestamp,
|
||||
games_count=len(games),
|
||||
earliest_game_ts=earliest_game_ts,
|
||||
data=games_stats
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue