Esterni / pyracing

A complete overhaul of the original ir_webstats; pyracing is an API client/wrapper for iRacing, the leading online simracing service. pyracing handles the queries to iRacing's (known) URL endpoints and maps the returned JSON data into structured objects, allowing for easier access to the data.
https://esterni.github.io/pyracing/
MIT License
66 stars 27 forks source link

Add subclass to next_session_times #24

Open Esterni opened 4 years ago

Esterni commented 4 years ago

The attribute 26 "raceWeekCars" is actually a dictionary of car_ids example from season 2865: {"110":{"maxPctFuelFill":"","weightPenaltyKG":"","max_dry_tire_sets":3,"powerAdjustPct":""},"56":{"maxPctFuelFill":"","weightPenaltyKG":"","max_dry_tire_sets":3,"powerAdjustPct":""},"103":{"maxPctFuelFill":"","weightPenaltyKG":"","max_dry_tire_sets":3,"powerAdjustPct":""}}

stucharo commented 4 years ago

There's something odd happening in next_session_times() where response.json()["d"] returns an empty list (rather than the expected dict)for some series. So far it looks like this happens on:

2720 : eNASCAR Coca-Cola Series 2861 : iRacing Endurance Le Mans Series 2721 : NASCAR Road to Pro 2811 : Nurburgring Endurance Championship 2817 : Porsche Esports Sprint Challenge 2812 : Porsche TAG Heuer Esports Supercup 2908 : WoO Late Model WC Series

Has this behaviour been noticed before? Any ideas why it would happen on those particular series? I'll try and have a closer look later if we don't have any more insight yet.

Edit: Nevermind, it's series with no upcoming sessions. I'll modify the client to check this condition.

Esterni commented 4 years ago

It's interesting that it doesn't provide what the next session would be, even if it's further into the future.

It might be good to log a response that no sessions were detected, which usually indicates a series that has sessions spread far apart.