Repository navigation
Expose underage on IPlayer - #67
Merged
Merged
Conversation
The player profile carries underage (-1 unknown / 0 no / 1 yes) since oddsfeedschema v1.1.0. IPlayer.Underage returns it as the new UnderageStatus enum; a missing attribute reads as Unknown. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
trbolat
approved these changes
Sep 25, 2026
Nested players are side-loaded from every competitor profile response, so a later payload without the attribute (another culture, or a producer that does not send it on nested players) reset a known Yes/No to Unknown, and the culture was marked loaded so nothing corrected it before the TTL. Assign only when the attribute is present; an explicit -1 still retracts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What & why
The REST player profile carries
underagesince oddsfeedschema v1.1.0, with the same-1unknown /0no /1yes encoding as competitors. This reads it and exposes it onIPlayer.player_profilePlayergets anunderageXML attribute (string, asxsd.exerenders the competitor one).UnderageStatusenum (Unknown = -1,No = 0,Yes = 1) inOddin.OddsFeedSdk.API.Entities.Abstractions, and an internalUnderageStatusParser; anything unexpected, includingnull, maps toUnknown.IPlayer.Underage/Player.Underage, backed by a single value onLocalizedPlayer(it is locale-independent).Unknownwhen the player cannot be loaded, matching how the other properties degrade.player_profilePlayerandPlayerCache.RefreshOrInsertItem, so they carry it too.ICompetitor.Underagestays astring; changing it would be a breaking API change.Verification
PlayerUnderageTests: parser theory (1,0,-1,null, empty, junk),LocalizedPlayerdefault, andXmlHelper.TryDeserializeof a profile withunderage="1".dotnet build(Release) 0 errors anddotnet test8/8 on the .NET 6 SDK image.🤖 Generated with Claude Code
Review follow-up (second commit)
HandlePlayersDatafeeds nestedplayer_profilePlayerobjects from every competitor profile response straight intoRefreshOrInsertItem, and the culture is then marked loaded, so an unconditional assignment let a second-culture or nested payload without the attribute reset a knownYes/NotoUnknownuntil the TTL.RefreshOrInsertItemnow assigns only whendata.underageis non-null; an explicit-1still retracts.CacheCarriesUnderageThroughToThePlayerAndKeepsItWhenAPayloadOmitsItside-loads a competitor profile through the existingPublishOnlyApiClientProxyharness, readsPlayer.Underage(Yes), publishes a second culture without the attribute (still Yes), then an explicit-1(Unknown).Verified again on the .NET 6 SDK image: build 0 errors,
PlayerUnderageTests9/9.