push @games, {
id => $ref->{'id'},
name => "$white–$black",
- url => $ref->{'url'}
+ url => $ref->{'url'},
+ hashurl => $ref->{'hash_url'},
};
};
if ($@) {
id varchar not null primary key,
json_path varchar not null,
url varchar not null,
+ hashurl varchar not null,
priority integer not null default 0,
);
for (var i = 0; i < current_games.length; ++i) {
if (current_games[i]['id'] === hash) {
if (backend_url !== current_games[i]['url']) {
- switch_backend(current_games[i]['url']);
+ switch_backend(current_games[i]['url'], current_games[i]['hashurl']);
}
return;
}
/**
* @param {string} new_backend_url
*/
-var switch_backend = function(new_backend_url) {
+var switch_backend = function(new_backend_url, new_backend_hash_url) {
// Stop looking at historic data.
current_display_line = null;
current_display_move = null;
// Request an immediate fetch with the new backend.
backend_url = new_backend_url;
+ backend_hash_url = new_backend_hash_url;
current_analysis_data = null;
ims = 0;
request_update();