]> git.sesse.net Git - ultimatescore/blobdiff - update_sheets.js
Fix syntax error.
[ultimatescore] / update_sheets.js
index aa4daa6a8559dbeeeed674da59352fa3ea910826..a656c89286f944211048ef070daf8ecb07fe7366 100644 (file)
@@ -74,6 +74,7 @@ function publish_group_rank(response, group_name)
        let teams = parse_teams_from_spreadsheet(response);
        let games = parse_games_from_spreadsheet(response, group_name, false);
        apply_games_to_teams(games, teams);
+       teams = filter_teams(teams, response);
 
        // Write the points total to the unsorted columns.
        if (config['point_total_start_row'] !== null) {
@@ -359,7 +360,9 @@ function fill_playoff(replacements, teams) {
                        "requests": meta_updates
                };
                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) {}, current_oauth_access_token);
+                       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'); });
+                       }, 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);
                });
        });
@@ -397,6 +400,7 @@ function get_ranked(response, group_name) {
        let teams = parse_teams_from_spreadsheet(response);
        let games = parse_games_from_spreadsheet(response, group_name, false);
        apply_games_to_teams(games, teams);
+       teams = filter_teams(teams, response);
        let tiebreakers = [];
        teams = rank(games, teams, 1, tiebreakers);
        return teams;