mirror of
https://github.com/ppy/osu.git
synced 2025-03-18 06:27:18 +08:00
Fix flags not showing on kudosu rankings
The `country` attribute is optional and not included in the kudosu rankings response so use `country_code` instead.
This commit is contained in:
parent
387de7ec24
commit
c8d276281a
@ -34,20 +34,15 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty(@"previous_usernames")]
|
||||
public string[] PreviousUsernames;
|
||||
|
||||
private CountryCode? countryCode;
|
||||
[JsonProperty(@"country_code")]
|
||||
private string countryCodeString;
|
||||
|
||||
public CountryCode CountryCode
|
||||
{
|
||||
get => countryCode ??= (Enum.TryParse(country?.Code, out CountryCode result) ? result : default);
|
||||
set => countryCode = value;
|
||||
get => Enum.TryParse(countryCodeString, out CountryCode result) ? result : CountryCode.Unknown;
|
||||
set => countryCodeString = value.ToString();
|
||||
}
|
||||
|
||||
#pragma warning disable 649
|
||||
[CanBeNull]
|
||||
[JsonProperty(@"country")]
|
||||
private Country country;
|
||||
#pragma warning restore 649
|
||||
|
||||
public readonly Bindable<UserStatus> Status = new Bindable<UserStatus>();
|
||||
|
||||
public readonly Bindable<UserActivity> Activity = new Bindable<UserActivity>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user