1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:02:55 +08:00

Add Availability to BeatmapSetOnlineInfo

This commit is contained in:
KingLuigi4932 2019-06-10 13:18:38 +03:00
parent 9a5d0695e9
commit 3fc604b60a
2 changed files with 22 additions and 1 deletions

View File

@ -65,6 +65,11 @@ namespace osu.Game.Beatmaps
/// The amount of people who have favourited this beatmap set.
/// </summary>
public int FavouriteCount { get; set; }
/// <summary>
/// The availability of this beatmap set.
/// </summary>
public BeatmapSetOnlineAvailability Availability { get; set; }
}
public class BeatmapSetOnlineCovers
@ -73,7 +78,7 @@ namespace osu.Game.Beatmaps
[JsonProperty(@"cover@2x")]
public string Cover { get; set; }
public string CardLowRes { get; set; }
[JsonProperty(@"card@2x")]
@ -84,4 +89,13 @@ namespace osu.Game.Beatmaps
[JsonProperty(@"list@2x")]
public string List { get; set; }
}
public class BeatmapSetOnlineAvailability
{
[JsonProperty(@"download_disabled")]
public bool DownloadDisabled { get; set; }
[JsonProperty(@"more_information")]
public string ExternalLink { get; set; }
}
}

View File

@ -60,6 +60,12 @@ namespace osu.Game.Online.API.Requests.Responses
set => Author.Id = value;
}
[JsonProperty(@"availability")]
private BeatmapSetOnlineAvailability availability { get; set; }
[JsonProperty(@"download_unavailable")]
private bool test { get; set; }
[JsonProperty(@"beatmaps")]
private IEnumerable<APIBeatmap> beatmaps { get; set; }
@ -83,6 +89,7 @@ namespace osu.Game.Online.API.Requests.Responses
Submitted = submitted,
Ranked = ranked,
LastUpdated = lastUpdated,
Availability = availability,
},
Beatmaps = beatmaps?.Select(b => b.ToBeatmap(rulesets)).ToList(),
};