1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-03 18:03:55 +08:00

set Beatmap.BeatmapSet to BeatmapSet property in SoloScoreInfo

This commit is contained in:
tsunyoku
2022-07-17 18:10:33 +01:00
Unverified
parent 7a6666996f
commit 8791edf84c
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using osu.Game.Beatmaps;
@@ -86,7 +87,19 @@ namespace osu.Game.Online.API.Requests.Responses
public APIBeatmap? Beatmap { get; set; }
[JsonProperty("beatmapset")]
public APIBeatmapSet? BeatmapSet { get; set; }
[CanBeNull]
public APIBeatmapSet BeatmapSet
{
set
{
// in the deserialisation case we need to ferry this data across.
// the order of properties returned by the API guarantees that the beatmap is populated by this point.
if (!(Beatmap is APIBeatmap apiBeatmap))
throw new InvalidOperationException("Beatmap set metadata arrived before beatmap metadata in response");
apiBeatmap.BeatmapSet = value;
}
}
[JsonProperty("pp")]
public double? PP { get; set; }