Fix Issue #262: still not getting all the teams player details from fetc#285
Open
DanielTomaro13 wants to merge 1 commit into
Open
Fix Issue #262: still not getting all the teams player details from fetc#285DanielTomaro13 wants to merge 1 commit into
DanielTomaro13 wants to merge 1 commit into
Conversation
… player details from fetc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Summary
Fixed Issue #262 by implementing a robust team name matching system that handles indigenous team names returned by the AFL API during Sir Doug Nicholls round. The issue was that
fetch_player_details_afl()couldn't match team names when the API temporarily returned indigenous names like "Kuwarna" instead of "Adelaide".Key Changes:
Enhanced team matching logic: Modified
team_check_afl2()andteam_abr_afl2()to try multiple matching approaches - first by team name, then by club name, then by club nickname, and finally by a comprehensive mapping that includes both regular and indigenous names.Comprehensive team name mappings: Added extensive mappings that cover all possible team name variations including indigenous names, nicknames, and alternative spellings. This ensures robust matching regardless of what the API returns.
Fallback mechanism: Implemented a fallback system that tries different matching strategies in sequence, ensuring that player details can be fetched even when the API returns unexpected team names.
Backward compatibility: All existing functionality remains intact while adding the robustness needed to handle the indigenous naming during special rounds.
Files Changed
R/helpers-afl.R