From ba17b851f392c1117e19cd6ece23445b6414097a Mon Sep 17 00:00:00 2001 From: Tr4il <6537388+Tr4il@users.noreply.github.com> Date: Wed, 3 May 2023 17:52:08 +0200 Subject: [PATCH] Added support for new Sprint weekend format Added support for new Sprint weekend format: - Added support for Sprint Shootout - Adjusted Sprint Qualifying to Sprint Race - Adjusted translations accordingly Small adjustment: - Separated Post-Qualifying Analysis and Ted's Qualifying Notebook --- modules/ergast.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/modules/ergast.py b/modules/ergast.py index 539039da..3bc88b22 100644 --- a/modules/ergast.py +++ b/modules/ergast.py @@ -29,6 +29,7 @@ terms = { "pre": ["pre", "voorbeschouwing"], "post": ["post", "nabeschouwing"], "quali": ["quali", "kwalificatie"], + "shootout": ["shootout"], "notebook": ["notebook", "notitieboekje"], "preview": ["preview", "seizoensvoorbeschouwing"], "summary": ["summary", "samenvatting"], @@ -41,9 +42,9 @@ names = { "Free Practice 1": "Vrije Training 1", "Free Practice 2": "Vrije Training 2", "Free Practice 3": "Vrije Training 3", - "Pre-Sprint Build-up": "Sprint Voorbeschouwing", - "Post-Sprint Analysis": "Sprint Nabeschouwing", - "Sprint Qualifying": "Sprint Kwalificatie", + "Pre-Sprint Race Build-up": "Sprint Race Voorbeschouwing", + "Post-Sprint Race Analysis": "Sprint Race Nabeschouwing", + "Sprint Race Session": "Sprint Race", "Ted's Sprint Notebook": "Ted's Sprint Notitieboekje", "Pre-Qualifying Build-up": "Kwalificatie Voorbeschouwing", "Post-Qualifying Analysis": "Kwalificatie Nabeschouwing", @@ -55,6 +56,10 @@ names = { "Highlights": "Samenvatting", "Race Session": "Race", "Ted's Race Notebook": "Ted's Race Notitieboekje", + "Ted's Qualifying Notebook": "Ted's Kwalificatie Notitieboekje", + "Pre-Sprint Shootout Build-up": "Sprint Shootout Voorbeschouwing", + "Post-Sprint Shootout Analysis": "Sprint Shootout Nabeschouwing", + "Sprint Shootout Session": "Sprint Shootout", } } @@ -91,20 +96,29 @@ class Race: output = "Free Practice 2" elif any([x in title for x in terms["free practice 3"]]): output = "Free Practice 3" + elif "shootout" in title: + if any([x in title for x in terms["pre"]]): + output = "Pre-Sprint Shootout Build-up" + elif any([x in title for x in terms["post"]]): + output = "Post-Sprint Shootout Analysis" + else: + output = "Sprint Shootout Session" elif "sprint" in title: if any([x in title for x in terms["pre"]]): - output = "Pre-Sprint Build-up" + output = "Pre-Sprint Race Build-up" elif any([x in title for x in terms["post"]]): - output = "Post-Sprint Analysis" + output = "Post-Sprint Race Analysis" elif any([x in title for x in terms["notebook"]]): output = "Ted's Sprint Notebook" else: - output = "Sprint Qualifying" + output = "Sprint Race Session" elif any([x in title for x in terms["quali"]]): if any([x in title for x in terms["pre"]]): output = "Pre-Qualifying Build-up" - elif any([x in title for x in terms["post"] + terms["notebook"]]): + elif any([x in title for x in terms["post"]]): output = "Post-Qualifying Analysis" + elif any ([x in title for x in terms["notebook"]]): + output = "Ted's Qualifying Notebook" else: output = "Qualifying Session" elif any([x in title for x in terms["preview"]]):