Skip to content

v3.6.0

Compare
Choose a tag to compare
@Afischbacher Afischbacher released this 05 Nov 03:46
· 4 commits to master since this release
4ad27d0

Release Notes for Version 3.6.0

Highlights

  • Timeout Extension: Increased the timeout duration from 30 to 60 seconds for all HTTP client constructors to improve reliability during long-running requests.

  • Game Center Enhancements:

    • Estimated Event Times: Added the ability to include estimated event date and time in game center play-by-play data.
    • Box Score Retrieval: Introduced the GetBoxscoreByGameIdAsync method to retrieve box score information.
  • Draft Rankings Support:

    • New Draft Classes: Added PlayerDraftRanking, PlayerDraftYear, and PlayerDraftCategory classes to represent draft-related data.
    • Draft Ranking Retrieval: Introduced the method GetPlayerDraftRankingByYearAsync to retrieve draft rankings by year.
  • Team Enumeration Updates:

    • Active Status Annotation: Added TeamActive attribute to team enumerations to indicate active/inactive status.
    • TeamActiveAttribute Class: Introduced TeamActiveAttribute for better handling of team status.
  • Statistics API Improvements:

    • Game Type Filtering: Updated statistics methods to include the gameType parameter, allowing for more specific data retrieval.
  • Refactoring and Code Quality:

    • Sealed Classes: Changed several classes to sealed and added static properties for better performance and code clarity.
    • Switch Expressions: Refactored methods in NhlTeamService to use switch expressions.
  • Documentation Updates:

    • README Enhancements: Updated documentation to reflect new methods and parameters.
    • API Usage Clarity: Improved explanations and usage examples.

Detailed Changes

Timeout Extension

Increased the default timeoutInSeconds parameter from 30 to 60 seconds in all HTTP client constructors to handle longer HTTP requests without timing out.

File Path Change Summary
Nhl.Api.Common/Http/NhlApiHttpClient.cs Constructor updated: timeoutInSeconds changed from 30 to 60.
Nhl.Api.Common/Http/NhlApiWebHttpClient.cs Constructor updated: timeoutInSeconds changed from 30 to 60.
Nhl.Api.Common/Http/NhlCmsHttpClient.cs Constructor updated: timeoutInSeconds changed from 30 to 60.
Nhl.Api.Common/Http/NhlEApiHttpClient.cs Constructor updated: timeoutInSeconds changed from 30 to 60.
Nhl.Api.Common/Http/NhlShiftChartHttpClient.cs Constructor updated: timeoutInSeconds changed from 30 to 60.
Nhl.Api.Common/Http/NhlStaticAssetsApiHttpClient.cs Constructor updated: timeoutInSeconds changed from 30 to 60.
Nhl.Api.Common/Http/NhlSuggestionApiHttpClient.cs Constructor updated: timeoutInSeconds changed from 30 to 60.

Game Center Enhancements

  • GameCenterPlayByPlay.cs

    • Changed Period property to a computed property.
    • Added new nullable property EstimatedDateTimeOfPlay.
  • NhlGameService.cs

    • Added method AddEstimatedDateTimeOfPlayForEachPlay to calculate estimated play times based on game data.
  • NhlGameApi.cs

    • Updated GetGameCenterPlayByPlayByGameIdAsync to include includeEventDateTime parameter.
    • Added GetBoxscoreByGameIdAsync method for box score retrieval.
File Path Change Summary
Nhl.Api.Domain/Models/Game/GameCenterPlayByPlay.cs Property Period changed to computed; added EstimatedDateTimeOfPlay.
Nhl.Api.Domain/Services/NhlGameService.cs Added AddEstimatedDateTimeOfPlayForEachPlay method for estimated play time calculation.
Nhl.Api/Src/GameApi/NhlGameApi.cs Updated GetGameCenterPlayByPlayByGameIdAsync; added GetBoxscoreByGameIdAsync method.

Draft Rankings Support

  • New Classes Added:

    • PlayerDraftRanking.cs
    • PlayerDraftYear.cs
    • PlayerDraftCategory.cs
  • API Updates:

    • Added GetPlayerDraftRankingByYearAsync method in NhlApi.cs, INhlPlayerApi.cs, and NhlPlayerApi.cs to fetch player draft rankings for a specific year.
File Path Change Summary
Nhl.Api.Domain/Models/Draft/PlayerDraftRanking.cs Introduced classes for draft-related data: PlayerDraftRanking, PlayerDraftYear, PlayerDraftCategory.
Nhl.Api/Src/Api/NhlApi.cs Added GetPlayerDraftRankingByYearAsync method.
Nhl.Api/Src/PlayerApi/INhlPlayerApi.cs Interface updated with GetPlayerDraftRankingByYearAsync method.
Nhl.Api/Src/PlayerApi/NhlPlayerApi.cs Implemented GetPlayerDraftRankingByYearAsync; updated GetPlayerHeadshotImageAsync for clarity.

Team Enumeration Updates

  • TeamEnum.cs

    • Added TeamActive attribute to each team enumeration member.
  • TeamActiveAttribute.cs

    • Introduced to annotate team enumerations with active status.
File Path Change Summary
Nhl.Api.Common/Attributes/TeamActiveAttribute.cs New attribute class TeamActiveAttribute added to mark NHL teams as active/inactive.
Nhl.Api.Domain/Enumerations/Team/TeamEnum.cs TeamActive attribute added to each team enum member indicating active status.

Statistics API Improvements

  • NhlStatisticsApi.cs
    • Updated methods to include gameType parameter, allowing users to filter statistics based on the type of game (e.g., regular season, playoffs).
File Path Change Summary
Nhl.Api/Src/StatisticsApi/NhlStatisticsApi.cs Methods updated to include gameType parameter; enhances filtering of statistics.

Refactoring and Code Quality

  • Sealed Classes and Static Properties:

    • DraftYear.cs and SeasonYears.cs changed to sealed classes.
    • Added static property AllSeasons for easy access to all seasons.
  • Switch Expressions:

    • Refactored methods in NhlTeamService.cs to use switch expressions, improving code readability and performance.
File Path Change Summary
Nhl.Api.Domain/Models/Season/SeasonYears.cs Class changed to sealed; added static property AllSeasons.
Nhl.Api.Domain/Services/NhlTeamService.cs Refactored methods to use switch expressions for better readability.

Version Update

Updated project version from 3.5.0 to 3.6.0 in all project files.

File Path Change Summary
Nhl.Api.Common/Nhl.Api.Common.csproj Project version updated to 3.6.0.
Nhl.Api.Domain/Nhl.Api.Domain.csproj Project version updated to 3.6.0.
Nhl.Api.Tests/Nhl.Api.Tests.csproj Project version updated to 3.6.0.
Nhl.Api/Nhl.Api.csproj Project version updated to 3.6.0.

Documentation Updates

  • README.md
    • Updated documentation to include new methods and parameters.
    • Enhanced clarity on API usage.
File Path Change Summary
Nhl.Api/README.md Documentation updated to reflect new methods and parameters; enhanced clarity on API usage.

SidneyCrosbyNhlGIF

Thank you for using the Nhl.Api! Please open a GitHub issue if you need anything!