Only check for missing scores

This commit is contained in:
2022-05-31 10:35:02 -05:00
parent 5fef7f8332
commit 8c3494e35d
3 changed files with 26 additions and 1 deletions

View File

@@ -99,6 +99,18 @@ class SheetsClient:
scores = ranges[1].get("values", [])
return self.score_dict(names, scores, completed_only=completed_only)
def get_missing_names(self):
if self.game_round is None:
raise ValueError(
"Cannot check missing names when day is not in a game round."
)
scores = self.get_scores()
missing_scores = []
for name, score_list in scores.items():
if len(score_list) < self.game_round or not score_list[self.game_round - 1]:
missing_scores.append(name)
return missing_scores
def write_scores(self, score_dict):
body = {"values": list(score_dict.values())}
sheets = self.client.spreadsheets()