Skip to content

Commit

Permalink
fix(nhlgt): errors due to missing period data
Browse files Browse the repository at this point in the history
ver(nhlgt): 2.0.9
ver(platform): 2024.3.1
  • Loading branch information
toddrob99 committed Mar 8, 2024
1 parent dcc813d commit dc2de9d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bots/nhl_game_threads/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import praw

__version__ = "2.0.8"
__version__ = "2.0.9"

DATA_LOCK = threading.Lock()

Expand Down
4 changes: 2 additions & 2 deletions bots/nhl_game_threads/templates/game_thread.mako
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Shootout! ${data["game"]["awayTeam"]["name"]["default"]}: ${shootout_data.get("a
% elif data["game"].get("clock", {}).get("inIntermission"):
Intermission
% else:
${periodOrd[data["game_boxscore"]["period"]]}${' Period' if data["game_boxscore"]["period"] <= 3 else ''} - ${data["game"]["clock"]["timeRemaining"]} \
${periodOrd[data["game_boxscore"].get("period", data["game_boxscore"].get("periodDescriptor", {}).get("number"))]}${' Period' if data["game_boxscore"].get("period", data["game_boxscore"].get("periodDescriptor", {}).get("number")) <= 3 else ''} - ${data["game"]["clock"]["timeRemaining"]} \
##% if data["game"]["liveData"]["linescore"]["teams"]["away"]["powerPlay"]:
##- ${data["game"]["gameData"]["teams"]["away"]["teamName"]} Power Play (${data["game"]["liveData"]["linescore"]["teams"]["away"]["numSkaters"]} on ${data["game"]["liveData"]["linescore"]["teams"]["home"]["numSkaters"]}) \
##% elif data["game"]["liveData"]["linescore"]["teams"]["home"]["powerPlay"]:
Expand All @@ -70,7 +70,7 @@ ${periodOrd[data["game_boxscore"]["period"]]}${' Period' if data["game_boxscore"
%elif result == "postponed":
${'##'} Game Status: Postponed
%elif result:
${'##'} Final${f'/{periodOrd[data["game_boxscore"]["period"]]}' if data["game_boxscore"]["period"] > 3 else ""}: \
${'##'} Final${f'/{periodOrd[data["game_boxscore"].get("period", data["game_boxscore"].get("periodDescriptor", {}).get("number"))]}' if data["game_boxscore"].get("period", data["game_boxscore"].get("periodDescriptor", {}).get("number")) > 3 else ""}: \
${maxScore} - ${minScore} \
% if result == "tie":
TIE
Expand Down
2 changes: 1 addition & 1 deletion bots/nhl_game_threads/templates/linescore.mako
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
awayLine = f'|[{awayTeam["commonName"]["default"]}]({data["teamSubs"][awayTeam["abbrev"]]})|'
homeLine = f'|[{homeTeam["commonName"]["default"]}]({data["teamSubs"][homeTeam["abbrev"]]})|'
for period in linescore:
headerLine += f'{periodOrd[period["period"]]}|'
headerLine += f'{periodOrd[period.get("period", period.get("periodDescriptor", {}).get("number"))]}|'
alignmentLine += ":--|"
awayLine += f'{period["away"]}|'
homeLine += f'{period["home"]}|'
Expand Down
2 changes: 1 addition & 1 deletion bots/nhl_game_threads/templates/penalties.mako
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ${'##'} Penalty Summary
if p.get("servedBy"):
desc += f"Served by {p['servedBy']}."
%>\
|${periodOrd[per.get('period')]}\
|${periodOrd[per.get("period", per.get("periodDescriptor", {}).get("number"))]}\
${(' ' + p.get('timeInPeriod')) if per.get('periodDescriptor', {}).get('periodType') != 'SO' else ''}|\
[${p['teamAbbrev']}](${data['teamSubs'].get(p['teamAbbrev'], '')})|\
${p['duration']}:00 ${sevs.get(p['type'], "")}|\
Expand Down
2 changes: 1 addition & 1 deletion bots/nhl_game_threads/templates/post_thread.mako
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ${'##'} [${awayTeam["name"]["default"]}](${data["teamSubs"][awayTeam["abbrev"]]}
%if result == "postponed":
${'##'} Game Status: Postponed
%elif result != "":
${'##'} Final${f'/{periodOrd[data["game_boxscore"]["period"]]}' if data["game_boxscore"]["period"] > 3 else ""}: \
${'##'} Final${f'/{periodOrd[data["game_boxscore"].get("period", data["game_boxscore"].get("periodDescriptor", {}).get("number"))]}' if data["game_boxscore"].get("period", data["game_boxscore"].get("periodDescriptor", {}).get("number")) > 3 else ""}: \
${maxScore} - ${minScore} \
% if result == "tie":
TIE
Expand Down
2 changes: 1 addition & 1 deletion bots/nhl_game_threads/templates/scoring_summary.mako
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ${'##'} Scoring Summary
if p.get("highlightClip"):
desc = f"[{desc}]({highlight_url(p['highlightClip'])})"
%>\
|${periodOrd[per.get('period')]}\
|${periodOrd[per.get("period", per.get("periodDescriptor", {}).get("number"))]}\
${(' ' + p.get('timeInPeriod')) if per.get('periodDescriptor', {}).get('periodType') != 'SO' else ''}|\
[${p.get('teamAbbrev', {}).get('default')}](${data['teamSubs'].get(p.get('teamAbbrev', {}).get('default'), '')})|\
${desc}|\
Expand Down
2 changes: 1 addition & 1 deletion redball/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env python

VERSION = "2024.1.1"
VERSION = "2024.3.1"

0 comments on commit dc2de9d

Please sign in to comment.