mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 18:33:20 +08:00
Merge pull request #15318 from peppy/beatmap-refactor/api-beatmap-serialisation-mutation
Allow setting of `APIBeatmap.Length` (and don't serialise twice)
This commit is contained in:
commit
07a486b78e
@ -90,7 +90,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
AddAssert("is visible", () => overlay.State.Value == Visibility.Visible);
|
||||
|
||||
AddStep("show many results", () => fetchFor(Enumerable.Repeat(CreateAPIBeatmapSet(Ruleset.Value), 10).ToArray()));
|
||||
AddStep("show many results", () => fetchFor(Enumerable.Repeat(CreateAPIBeatmapSet(Ruleset.Value), 100).ToArray()));
|
||||
|
||||
AddUntilStep("placeholder hidden", () => !overlay.ChildrenOfType<BeatmapListingOverlay.NotFoundDrawable>().Any(d => d.IsPresent));
|
||||
|
||||
|
@ -54,10 +54,15 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty(@"accuracy")]
|
||||
private float overallDifficulty { get; set; }
|
||||
|
||||
public double Length => TimeSpan.FromSeconds(lengthInSeconds).TotalMilliseconds;
|
||||
[JsonIgnore]
|
||||
public double Length { get; set; }
|
||||
|
||||
[JsonProperty(@"total_length")]
|
||||
private double lengthInSeconds { get; set; }
|
||||
private double lengthInSeconds
|
||||
{
|
||||
get => TimeSpan.FromMilliseconds(Length).TotalSeconds;
|
||||
set => Length = TimeSpan.FromSeconds(value).TotalMilliseconds;
|
||||
}
|
||||
|
||||
[JsonProperty(@"count_circles")]
|
||||
public int CircleCount { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user