]> git.sesse.net Git - ultimatescore/blobdiff - update_sheets.js
Start working on Trøndisk 2021.
[ultimatescore] / update_sheets.js
index 3a7b0f7f9611decc700e18dfd4b201017e45bb9d..fb7c96d6814d6ec89c41692dbc0b8ce3190f1a34 100644 (file)
@@ -366,8 +366,9 @@ function fill_playoff(replacements, teams) {
 
                        if (game[2] == 0) {  // Stream field.
                                // Game.
+                               let ss_row = ultimateconfig['playoff_games_start_row_detail_sheet'] + game_num;
                                updates.push({
-                                       "range": "Playoffs!A" + (game_num + 32) + ":J" + (game_num + 32),
+                                       "range": "Playoffs!A" + ss_row + ":J" + ss_row,
                                        "values": [ [ team1, team2, score1, score2, "", "", "", game_day, response['values'][row - 1][1].replace(".",":"), game[6] ] ]
                                });
 
@@ -393,7 +394,7 @@ function fill_playoff(replacements, teams) {
                };
                possibly_update_oauth_key(function() {
                        post_json('https://sheets.googleapis.com/v4/spreadsheets/' + ultimateconfig['score_sheet_id'] + '/values:batchUpdate?key=' + ultimateconfig['api_key'], json, function(response) {
-                               get_group('Playoffs 9th-13th', function(response_l) { publish_group_rank(response_l, 'Playoffs 9th-13th'); });
+                               get_group('Playoffs 9th-14th', function(response_l) { publish_group_rank(response_l, 'Playoffs 9th-14th'); });
                        }, current_oauth_access_token);
                        post_json('https://sheets.googleapis.com/v4/spreadsheets/' + ultimateconfig['score_sheet_id'] + ':batchUpdate?key=' + ultimateconfig['api_key'], meta_json, function(response) {}, current_oauth_access_token);
                });
@@ -477,6 +478,7 @@ function addsign(x)
 }
 
 function publish_best_thirds() {
+       if (!ultimateconfig['best_thirds']) return;
        get_group('Group A', function(response_a) {
                get_group('Group B', function(response_b) {
                        get_group('Group C', function(response_c) {