Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
HOTFIX goal and penalty causing crashes. Bump version to V1.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
User Name committed Feb 29, 2024
1 parent ddf9b7c commit 328eaf3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.0
1.8.2
11 changes: 5 additions & 6 deletions src/renderer/goal.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from PIL import Image, ImageFont, ImageDraw, ImageSequence
from utils import center_text, convert_date_format,strip_accents
from utils import center_text, convert_date_format
from renderer.matrix import MatrixPixels
import debug


"""
Show the details of a goal:
- Time of the goal and which period
Expand Down Expand Up @@ -73,13 +72,13 @@ def draw_scorer(self):

self.matrix.draw_text(
(8, 20),
strip_accents(self.scorer["info"]["firstName"]["default"].upper()),
self.scorer["info"]["firstName"]["default"].upper(),
font=self.font,
fill=(255,255,255)
)
self.matrix.draw_text(
(8, 26),
strip_accents(self.scorer["info"]["lastName"]["default"].upper()),
self.scorer["info"]["lastName"]["default"].upper(),
font=self.font,
fill=(255,255,255)
)
Expand All @@ -95,7 +94,7 @@ def draw_details(self):

scorer_name_coord = self.matrix.draw_text(
(1, 8),
strip_accents(self.scorer["info"]["lastName"]["default"].upper()),
self.scorer["info"]["lastName"]["default"].upper(),
font=self.font,
fill=(255, 255, 255)
)
Expand All @@ -119,7 +118,7 @@ def draw_details(self):
for i in range(len(self.assists)):
assist_name_coord = self.matrix.draw_text(
(1, assists_y_pos),
strip_accents(self.assists[i]["info"]["lastName"]["default"].upper()),
self.assists[i]["info"]["lastName"]["default"].upper(),
font=self.font,
fill=(255, 255, 255)
)
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def render(self):
#Standings(self.data, self.matrix, self.sleepEvent).render()
# self.data.test_goal(self.data, self.matrix, self.sleepEvent)
#self._draw_event_animation("goal", self.scoreboard.home_team.id, self.scoreboard.home_team.name)
PenaltyRenderer(self.data, self.matrix, self.sleepEvent, self.scoreboard.away_team).render()
GoalRenderer(self.data, self.matrix, self.sleepEvent, self.scoreboard.away_team).render()
#TeamSummary(self.data, self.matrix, self.sleepEvent).render()
sleep(1)
debug.info("Testing Mode Refresh")
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/penalty.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PIL import Image, ImageFont, ImageDraw, ImageSequence
from utils import center_text, convert_date_format, strip_accents
from utils import center_text, convert_date_format
from renderer.matrix import MatrixPixels
import debug
from nhl_api.info import TeamInfo
Expand Down Expand Up @@ -67,7 +67,7 @@ def draw_penalty(self):

self.matrix.draw_text_layout(
self.layout.last_name,
strip_accents(self.player["lastName"]["default"])
self.player["lastName"]["default"]
)
self.matrix.draw_text_layout(
self.layout.minutes,
Expand Down
5 changes: 1 addition & 4 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,4 @@ def convert_date_format(date):
def round_normal(n, decimals=0):
multiplier = 10 ** decimals
value = math.floor(n * multiplier + 0.5) / multiplier
return int(value) if decimals == 0 else value

def strip_accents(str):
return "".join(c for c in unicodedata.normalize("NFD", str) if not unicodedata.combining(c))
return int(value) if decimals == 0 else value

0 comments on commit 328eaf3

Please sign in to comment.