From d77ada7ee09586f6028365f0baabf0f6704c63fc Mon Sep 17 00:00:00 2001 From: M0ntyP <120065017+M0ntyP@users.noreply.github.com> Date: Sun, 29 Dec 2024 10:03:03 +1030 Subject: [PATCH] Update PGA Tour --- apps/pgatour/pga_tour.star | 67 +++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/apps/pgatour/pga_tour.star b/apps/pgatour/pga_tour.star index 74fb7f8a3..b60107dfd 100644 --- a/apps/pgatour/pga_tour.star +++ b/apps/pgatour/pga_tour.star @@ -67,6 +67,9 @@ Bug fix - During play, the completed round scores were showing the previous roun v2.8 Fixed situation that when play is suspended, "state" value = "post" (round is complete) and does not show in progress scores for the suspended round, Also, updated title bar to show that play is suspended + +v2.9 +Updated Tournament IDs for 2025 Season """ load("encoding/json.star", "json") @@ -80,7 +83,7 @@ API2 = "https://site.api.espn.com/apis/site/v2/sports/golf/pga/scoreboard" CACHE_TTL_SECS = 60 DEFAULT_TIMEZONE = "Australia/Adelaide" -THE_EXCEPTIONS = ["401580329", "401580360"] # The Sentry and The Open +THE_EXCEPTIONS = ["401703489", "401703521"] # The Sentry and The Open # List will be a work in progress PLAYER_MAPPING = """ @@ -100,40 +103,42 @@ PLAYER_MAPPING = """ TOURNAMENT_MAPPING = """ { - "401580332": "Farmers Ins", - "401580333": "AT&T Pro-Am", - "401580335": "Genesis Inv", - "401580338": "Arnold Palm", + "401703491": "The AmEx", + "401703492": "Farmers Ins", + "401703493": "AT&T Pro-Am", + "401703495": "Genesis Inv", + "401703498": "Arnold Palm", "401580340": "The Players", - "401580347": "Zurich Clas", - "401580346": "Puntacana", - "401580348": "CJ Cup", - "401580341": "Valspar", - "401580342": "Houston Opn", - "401580343": "Texas Open", - "401580344": "The Masters", - "401580345": "Heritage", - "401580353": "Canadian Op", - "401580354": "Memorial", - "401580351": "PGA Champ", + "401703507": "Zurich Clas", + "401703506": "Puntacana", + "401703508": "The CJ Cup", + "401703501": "Valspar", + "401703502": "Houston Opn", + "401703503": "Texas Open", + "401703504": "The Masters", + "401703505": "Heritage", + "401703514": "Canadian Op", + "401703513": "Memorial", + "401703511": "PGA Champ", "401465538": "Barbasol", - "401580359": "Scottish", - "401580363": "Wyndham", - "401580364": "FedEx St.J", - "401580365": "BMW Champ", + "401703519": "Scottish", + "401703524": "Wyndham", + "401703525": "FedEx St.J", + "401703530": "BMW Champ", "401558309": "Q-School", - "401634279": "Kentucky", - "401580361": "Barracuda" + "401703520": "ISCO Champ", + "401703522": "Barracuda", + "401703531": "TOUR CHAMP" } """ MAJOR_MAPPING = """ { - "401580340": "#003360", - "401580344": "#006747", - "401580351": "#00205B", - "401580355": "#003865", - "401580360": "#1A1C3C" + "401703500": "#003360", + "401703504": "#006747", + "401703511": "#00205B", + "401703515": "#003865", + "401703521": "#1A1C3C" } """ @@ -415,6 +420,8 @@ def getPlayerProgress(x, s, t, Title, TitleColor, ColorGradient, stage, state, t LeaderTeeTime = s[0]["status"]["teeTime"] LeaderTeeTimeFormat = time.parse_time(LeaderTeeTime, format = "2006-01-02T15:04Z").in_location(timezone) TimeDiff = LeaderTeeTimeFormat - time.now() + + #print(TimeDiff) if TimeDiff.hours < 12: ShowTeeTimes = True @@ -564,11 +571,11 @@ def getPlayerFontColor(HolesCompleted, ColorGradient): def OppositeFieldCheck(ID): # check the ID of the event, and if its a tournament with an opposite field go to the second event in the API i = 0 - if ID == "401580349": # Wells Fargo -> Myrtle Beach + if ID == "401703509": # Truist -> Myrtle Beach i = 1 - elif ID == "401580360": # The Open -> Barracuda + elif ID == "401703521": # The Open -> Barracuda i = 1 - elif ID == "401580359": # Scottish Open -> Kentucky Champ + elif ID == "401703519": # Scottish Open -> ISCO Champ i = 1 else: i = 0