fix critical bugs

This commit is contained in:
vrubel 2026-02-05 01:38:33 +03:00
parent 0de0deb14f
commit 20f96d0e0a
3 changed files with 11 additions and 9 deletions

View file

@ -648,8 +648,8 @@ class StatsService:
since_ms = since_timestamp * 1000
until_ms = until_timestamp * 1000
# Получаем игры
games = await self.lichess_client.get_games_of_period(username, since_ms, until_ms, rated_only)
# Получаем игры (без фильтра rated в запросе к Lichess — см. lichess_client)
games = await self.lichess_client.get_games_of_period(username, since_ms, until_ms, rated_only=False)
if games is None:
return GamesOfPeriodResponse(
@ -660,6 +660,10 @@ class StatsService:
games_count=0
)
# Фильтр по рейтинговости на нашей стороне (API Lichess с param rated даёт неверный результат)
if rated_only:
games = [g for g in games if g.get('rated') is True]
if not games:
return GamesOfPeriodResponse(
message=f"Игры за указанный период не найдены",