Skip to content

Commit 90bc3d6

Browse files
committed
fix(game analysis): Make sure that both usernames are same case
Chess usernames are not case sensitive.
1 parent e7039c0 commit 90bc3d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

style_predictor/tasks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def get_games_analysis(
241241
Returns:
242242
Dict with statistical analysis of the games provided.
243243
"""
244-
names = {n.strip() for n in username.split("||")}
244+
names = {n.strip().lower() for n in username.split("||")}
245245
total = len(pgn_games)
246246
wins = losses = draws = 0
247247
opp_mapping: list[tuple[int, int | None]] = []
@@ -254,8 +254,8 @@ def get_games_analysis(
254254
if eco_code := tags.get("ECO", None):
255255
opening_mapper.append((eco_code, " ".join([str(move) for move in g.moves])))
256256

257-
is_white = white in names
258-
is_black = black in names
257+
is_white = white.lower() in names
258+
is_black = black.lower() in names
259259

260260
# win/loss/draw
261261
if result == constants.DRAW:

0 commit comments

Comments
 (0)