1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 02:02:53 +08:00

Update to support newer return structure from osu-web API

This commit is contained in:
Dean Herbert 2017-09-14 18:08:12 +09:00
parent 307a709e6b
commit 7cd6caacaa
3 changed files with 8 additions and 26 deletions

View File

@ -33,13 +33,10 @@ namespace osu.Desktop.Tests.Visual
Rank = 2148, Rank = 2148,
PP = 4567.89m PP = 4567.89m
}, },
AllRankHistories = new User.RankHistories RankHistory = new User.RankHistoryData
{
Osu = new User.RankHistory
{ {
Mode = @"osu", Mode = @"osu",
Data = Enumerable.Range(2345,45).Concat(Enumerable.Range(2109,40)).ToArray() Data = Enumerable.Range(2345, 45).Concat(Enumerable.Range(2109, 40)).ToArray()
}
} }
}, false)); }, false));
AddStep("Show ppy", () => profile.ShowUser(new User AddStep("Show ppy", () => profile.ShowUser(new User

View File

@ -70,7 +70,7 @@ namespace osu.Game.Overlays.Profile
} }
}; };
ranks = user.AllRankHistories?.Osu?.Data ?? new[] { user.Statistics.Rank }; ranks = user.RankHistory?.Data ?? new[] { user.Statistics.Rank };
} }
private void updateRankTexts() private void updateRankTexts()

View File

@ -122,25 +122,10 @@ namespace osu.Game.Users
public int Available; public int Available;
} }
[JsonProperty(@"defaultStatistics")] [JsonProperty(@"statistics")]
public UserStatistics Statistics; public UserStatistics Statistics;
public class RankHistories public class RankHistoryData
{
[JsonProperty(@"osu")]
public RankHistory Osu;
[JsonProperty(@"taiko")]
public RankHistory Taiko;
[JsonProperty(@"fruits")]
public RankHistory Fruits;
[JsonProperty(@"mania")]
public RankHistory Mania;
}
public class RankHistory
{ {
[JsonProperty(@"mode")] [JsonProperty(@"mode")]
public string Mode; public string Mode;
@ -149,7 +134,7 @@ namespace osu.Game.Users
public int[] Data; public int[] Data;
} }
[JsonProperty(@"allRankHistories")] [JsonProperty(@"rankHistory")]
public RankHistories AllRankHistories; public RankHistoryData RankHistory;
} }
} }