mirror of
https://github.com/ppy/osu
synced 2025-02-01 10:51:53 +00:00
Merge pull request #1267 from peppy/user-profile-api-update
Update profiles to support newer return structure from osu-web API
This commit is contained in:
commit
9adf38d5e1
@ -33,13 +33,10 @@ namespace osu.Desktop.Tests.Visual
|
||||
Rank = 2148,
|
||||
PP = 4567.89m
|
||||
},
|
||||
AllRankHistories = new User.RankHistories
|
||||
RankHistory = new User.RankHistoryData
|
||||
{
|
||||
Osu = new User.RankHistory
|
||||
{
|
||||
Mode = @"osu",
|
||||
Data = Enumerable.Range(2345,45).Concat(Enumerable.Range(2109,40)).ToArray()
|
||||
}
|
||||
Mode = @"osu",
|
||||
Data = Enumerable.Range(2345, 45).Concat(Enumerable.Range(2109, 40)).ToArray()
|
||||
}
|
||||
}, false));
|
||||
AddStep("Show ppy", () => profile.ShowUser(new User
|
||||
|
@ -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()
|
||||
|
@ -122,25 +122,10 @@ namespace osu.Game.Users
|
||||
public int Available;
|
||||
}
|
||||
|
||||
[JsonProperty(@"defaultStatistics")]
|
||||
[JsonProperty(@"statistics")]
|
||||
public UserStatistics Statistics;
|
||||
|
||||
public class RankHistories
|
||||
{
|
||||
[JsonProperty(@"osu")]
|
||||
public RankHistory Osu;
|
||||
|
||||
[JsonProperty(@"taiko")]
|
||||
public RankHistory Taiko;
|
||||
|
||||
[JsonProperty(@"fruits")]
|
||||
public RankHistory Fruits;
|
||||
|
||||
[JsonProperty(@"mania")]
|
||||
public RankHistory Mania;
|
||||
}
|
||||
|
||||
public class RankHistory
|
||||
public class RankHistoryData
|
||||
{
|
||||
[JsonProperty(@"mode")]
|
||||
public string Mode;
|
||||
@ -149,7 +134,7 @@ namespace osu.Game.Users
|
||||
public int[] Data;
|
||||
}
|
||||
|
||||
[JsonProperty(@"allRankHistories")]
|
||||
public RankHistories AllRankHistories;
|
||||
[JsonProperty(@"rankHistory")]
|
||||
public RankHistoryData RankHistory;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user