Skip to content

Commit

Permalink
Add "kph" Version of Pit Road Speed Limit
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianJSClark committed Dec 21, 2023
1 parent f762429 commit ec38573
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 49 deletions.
50 changes: 1 addition & 49 deletions src/Aydsko.iRacingData/Package Release Notes.txt
Original file line number Diff line number Diff line change
@@ -1,51 +1,3 @@
Fixes / Changes:

- BREAKING CHANGE: Enumeration added for League Session "Status" field. (Issue: 182)
- Previous "int" value available as "StatusRaw" property.

- Removal of legacy "Microsoft.AspNetCore.WebUtilities" dependency, replaced with custom code.

- .NET 8 Support
- Projects are built using the .NET 8 SDK
- Dependencies updated
- .NET 8 targeted build included

- Check Club Image Paths (Issue: 189)

- Fix "Interval" property on "SubsessionChartLap" so it doesn't throw an exception when driver has been lapped, which is a valid situation.

- Fix "Implementing SaveCookies and RestoreCookies does not prevent unnecessary logins" (Issue: #186)
- If you implement the "SaveCookies" and "RestoreCookies" methods and the cookies are for the correct domain, then the library will not attempt to login again.

- "DataClient" class is now "public" so it can be used outside of the library. It is still recommended to resolve the "IDataClient" interface from the DI container in most situations.

- Fix "Auth concurrency issues" (Issue #185)
- The library now uses a semaphore to prevent multiple login attempts at the same time on the same instance of the "DataClient" class.



Contributions:

- From Tobias Zürcher (https://github.com/tobiaszuercher):
- Add missing car_class_name & car_class_short_name (Pull Request: 190)

Thanks for helping out with pull requests to the library!



New Versioning Scheme:

Ideally you should always use the latest version of the library that is available. This is because iRacing will sometimes introduce API changes during a release which make the old code incompatible.

This library will use version numbers will be in the format:

[YY][SS].[R]

Where:
- YY = two digit year
- SS = the iRacing season the library release was made in as a zero-padded number (i.e. 01, 02, 03, 04)
- R = release number, which increments when changes are made although it may not be sequential

Example:

- 2303.1 = changes compatible with iRacing 2023 Season 3 or later, and is release 1 during this season
- New property on "Tracks.Track" called "PitRoadSpeedLimitKph" which returns the pit road speed limit in kilometers per hour.
5 changes: 5 additions & 0 deletions src/Aydsko.iRacingData/Tracks/Track.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,14 @@ public class Track
[JsonPropertyName("package_id")]
public int PackageId { get; set; }

/// <summary>Speed limit for pit road in miles-per-hour (mph)</summary>
[JsonPropertyName("pit_road_speed_limit")]
public int PitRoadSpeedLimit { get; set; }

/// <summary>Speed limit for pit road in kilometres-per-hour (mph)</summary>
[JsonIgnore]
public int PitRoadSpeedLimitKph => (int)Math.Round(PitRoadSpeedLimit * 1.609344M);

[JsonPropertyName("price")]
public decimal Price { get; set; }

Expand Down

0 comments on commit ec38573

Please sign in to comment.