X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=remoteglot.pl;h=aaaed104ea94a2fd73ab316678129b4f66b5bf18;hp=6a5778a0b96b3c321d0095b21fa92bd67d018904;hb=325527f1f2d4c3e8a1648690da349f30f8e79759;hpb=9876a860a0ceb0d64fcf074ddecb08ac207c0aa5 diff --git a/remoteglot.pl b/remoteglot.pl index 6a5778a..aaaed10 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -273,6 +273,12 @@ sub handle_pgn { warn "Error in parsing PGN from $url\n"; } else { eval { + # Skip to the right game. + while (defined($remoteglotconf::pgn_filter) && + !&$remoteglotconf::pgn_filter($pgn)) { + $pgn->read_game() or die "Out of games during filtering"; + } + $pgn->parse_game({ save_comments => 'yes' }); my $pos = Position->start_pos($pgn->white, $pgn->black); my $moves = $pgn->moves; @@ -309,7 +315,7 @@ sub handle_pgn { } }; if ($@) { - warn "Error in parsing moves from $url\n"; + warn "Error in parsing moves from $url: $@\n"; } } @@ -1011,6 +1017,9 @@ sub extract_clock { $pos->{'black_clock'} = $1; return; } + + delete $pos->{'white_clock'}; + delete $pos->{'black_clock'}; } sub find_clock_start {