X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=update_sheets.js;h=7cfe0fda6cc320bfdc2532e58a1d7d766aa5ccec;hb=52c58f61b5a9799ccbd8ef5dd067f502b81e9aaf;hp=d9757b21bee385b92276b05dc5cc3f9cab171d89;hpb=44bf264bc9045503216832dcc7261f885983df4c;p=ultimatescore diff --git a/update_sheets.js b/update_sheets.js index d9757b2..7cfe0fd 100644 --- a/update_sheets.js +++ b/update_sheets.js @@ -69,9 +69,9 @@ function publish_group_rank(group_name) { get_group(group_name, function(response, group_name) { let updates = []; - let cols = ["Results!B", "Results!C", "Results!D"]; + let cols = ["Results!M", "Results!N", "Results!O"]; if (group_name === 'Group B') { - cols = ["Results!F", "Results!G", "Results!H"]; + cols = ["Results!Q", "Results!R", "Results!S"]; } let teams = parse_teams_from_spreadsheet(response); @@ -80,7 +80,7 @@ function publish_group_rank(group_name) // Write the points total to the unsorted columns. for (let i = 0; i < teams.length; ++i) { - updates.push({ "range": cols[2] + (4 + i), "values": [ [ teams[i].pts ] ] }); + updates.push({ "range": cols[2] + (10 + i), "values": [ [ teams[i].pts ] ] }); } let tiebreakers = []; @@ -88,16 +88,16 @@ function publish_group_rank(group_name) // Write the ranking table, from scratch. for (let i = 0; i < teams.length; ++i) { - updates.push({ "range": cols[0] + (10 + i), "values": [ [ teams[i].rank ] ] }); - updates.push({ "range": cols[1] + (10 + i), "values": [ [ teams[i].shortname ] ] }); - updates.push({ "range": cols[2] + (10 + i), "values": [ [ teams[i].pts ] ] }); + updates.push({ "range": cols[0] + (19 + i), "values": [ [ teams[i].rank ] ] }); + updates.push({ "range": cols[1] + (19 + i), "values": [ [ teams[i].shortname ] ] }); + updates.push({ "range": cols[2] + (19 + i), "values": [ [ teams[i].pts ] ] }); } let tb_str = ""; if (tiebreakers.length != 0) { tb_str = tiebreakers.join("\n"); } - updates.push({ "range": cols[0] + "15", "values": [ [ tb_str ] ]}); + updates.push({ "range": cols[0] + "25", "values": [ [ tb_str ] ]}); let json = { "valueInputOption": "USER_ENTERED",