Skip to content

Commit

Permalink
Merge pull request #27 from franciscoBSalgueiro/26-the-wdl-results-of…
Browse files Browse the repository at this point in the history
…-players-from-database-are-incorrect

Fix incorrect wdl information in database
  • Loading branch information
franciscoBSalgueiro authored Oct 2, 2023
2 parents aa5c22d + 74ab00d commit e41e7cc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src-tauri/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,14 @@ pub async fn get_players_game_info(
assert!(is_white || black_id == id);

match outcome.unwrap_or_default().as_str() {
"1-0" => game_info.won += 1,
"0-1" => game_info.lost += 1,
"1-0" => match is_white {
true => game_info.won += 1,
false => game_info.lost += 1,
},
"0-1" => match is_white {
true => game_info.lost += 1,
false => game_info.won += 1,
},
"1/2-1/2" => game_info.draw += 1,
_ => (),
}
Expand Down

0 comments on commit e41e7cc

Please sign in to comment.