1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 23:12:56 +08:00

Fix inability to serialise-then-deserialise playlist items

This commit is contained in:
Dan Balasescu 2022-06-03 20:36:11 +09:00
parent 646f5f0f33
commit 77289c7224

View File

@ -61,7 +61,13 @@ namespace osu.Game.Online.Rooms
/// Used for serialising to the API.
/// </summary>
[JsonProperty("beatmap_id")]
private int onlineBeatmapId => Beatmap.OnlineID;
private int onlineBeatmapId
{
get => Beatmap.OnlineID;
// This setter is only required for client-side serialise-then-deserialise operations.
// Serialisation is supposed to emit only a `beatmap_id`, but a (non-null) `beatmap` is required on deserialise.
set => Beatmap = new APIBeatmap { OnlineID = value };
}
/// <summary>
/// A beatmap representing this playlist item.