}
$pgn->parse_game({ save_comments => 'yes' });
- my $pos = Position->start_pos($pgn->white, $pgn->black);
+ my $white = $pgn->white;
+ my $black = $pgn->black;
+ $white =~ s/,.*//; # Remove first name.
+ $black =~ s/,.*//; # Remove first name.
+ my $pos = Position->start_pos($white, $black);
my $moves = $pgn->moves;
my @uci_moves = ();
my @repretty_moves = ();
push @games, {
id => $ref->{'id'},
name => "$white–$black",
- url => $ref->{'url'}
+ url => $ref->{'url'},
+ hashurl => $ref->{'hash_url'},
+ score => $other_game_json->{'score'}
};
};
if ($@) {
$dbh->do('INSERT INTO scores (id, score_type, score_value, engine, depth, nodes) VALUES (?,?,?,?,?,?) ' .
' ON CONFLICT (id) DO UPDATE SET ' .
' score_type=EXCLUDED.score_type, ' .
- ' score_value=EXCLUDED.score_vlaue, ' .
+ ' score_value=EXCLUDED.score_value, ' .
' engine=EXCLUDED.engine, ' .
' depth=EXCLUDED.depth, ' .
' nodes=EXCLUDED.nodes',