Adding some more trackday providers to the /trackday command and also filtering for tracks based on the venue name, not the event title
This commit is contained in:
parent
b4bb329eee
commit
d7ad9840c8
@ -7,14 +7,16 @@ import xmltodict
|
|||||||
async def get_msreg(track):
|
async def get_msreg(track):
|
||||||
base_url = "https://api.motorsportreg.com/rest/calendars/organization"
|
base_url = "https://api.motorsportreg.com/rest/calendars/organization"
|
||||||
orgs = {
|
orgs = {
|
||||||
"speeddistrict": "2E22740B-E8C9-9FB9-21406A496429A28B",
|
|
||||||
"ongrid": "06277C99-00C9-23EB-FD08FE5275BCC0C5",
|
|
||||||
"speedsf": "072A885E-AD68-6F64-E88C19E4D0D21DFB",
|
|
||||||
"turn8": "F3469266-BEFF-E329-4FD6C4B189ACE2A8",
|
"turn8": "F3469266-BEFF-E329-4FD6C4B189ACE2A8",
|
||||||
"speedventures": "DF7453ED-BF33-DC17-2C9BFD84C1F05E86",
|
"speedventures": "DF7453ED-BF33-DC17-2C9BFD84C1F05E86",
|
||||||
|
"speedsf": "072A885E-AD68-6F64-E88C19E4D0D21DFB",
|
||||||
|
"speeddistrict": "2E22740B-E8C9-9FB9-21406A496429A28B",
|
||||||
|
"socaldriversclub": "B4FC0113-C903-E9D3-68562D6765806945",
|
||||||
|
"ongrid": "06277C99-00C9-23EB-FD08FE5275BCC0C5",
|
||||||
"nextlevel": "CC23AEA4-AAB1-D087-4A10818D229DAFD2",
|
"nextlevel": "CC23AEA4-AAB1-D087-4A10818D229DAFD2",
|
||||||
"lightspeed": "BC6417B8-0ED9-DD48-28BA1463C2C14322",
|
"lightspeed": "BC6417B8-0ED9-DD48-28BA1463C2C14322",
|
||||||
"socaldriversclub": "B4FC0113-C903-E9D3-68562D6765806945",
|
"fast_toys": "F2829F4E-91A1-30B9-919956FB1BE3CFB4",
|
||||||
|
"drive_tracktime": "F8940175-D299-85F5-4BFFE1243A2D0B88",
|
||||||
}
|
}
|
||||||
events = {}
|
events = {}
|
||||||
client = httpx.AsyncClient()
|
client = httpx.AsyncClient()
|
||||||
@ -41,7 +43,9 @@ async def get_msreg(track):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
for event in json_blob["event"]:
|
for event in json_blob["event"]:
|
||||||
if any(x in event["name"].lower() for x in tracks_we_care_about):
|
if any(
|
||||||
|
x in event["venue"]["name"].lower() for x in tracks_we_care_about
|
||||||
|
):
|
||||||
event_object = {
|
event_object = {
|
||||||
"event_organizer": event["organization"]["name"],
|
"event_organizer": event["organization"]["name"],
|
||||||
"event_name": event["name"],
|
"event_name": event["name"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user