Add new statistic types to online info

This commit is contained in:
Bartłomiej Dach 2021-10-17 20:55:06 +02:00
parent 04c2a9cd59
commit c0b5b0e909
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
4 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,25 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using Newtonsoft.Json;
namespace osu.Game.Beatmaps
{
/// <summary>
/// Contains information about the current hype status of a beatmap set.
/// </summary>
public class BeatmapSetHypeStatus
{
/// <summary>
/// The current number of hypes that the set has received.
/// </summary>
[JsonProperty(@"current")]
public int Current { get; set; }
/// <summary>
/// The number of hypes required so that the set is eligible for nomination.
/// </summary>
[JsonProperty(@"required")]
public int Required { get; set; }
}
}

View File

@ -0,0 +1,25 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using Newtonsoft.Json;
namespace osu.Game.Beatmaps
{
/// <summary>
/// Contains information about the current nomination status of a beatmap set.
/// </summary>
public class BeatmapSetNominationStatus
{
/// <summary>
/// The current number of nominations that the set has received.
/// </summary>
[JsonProperty(@"current")]
public int Current { get; set; }
/// <summary>
/// The number of nominations required so that the map is eligible for qualification.
/// </summary>
[JsonProperty(@"required")]
public int Required { get; set; }
}
}

View File

@ -102,5 +102,19 @@ namespace osu.Game.Beatmaps
/// Total vote counts of user ratings on a scale of 0..10 where 0 is unused (probably will be fixed at API?).
/// </summary>
int[]? Ratings { get; }
/// <summary>
/// Contains the current hype status of the beatmap set.
/// Non-null only for <see cref="BeatmapSetOnlineStatus.WIP"/>, <see cref="BeatmapSetOnlineStatus.Pending"/>, and <see cref="BeatmapSetOnlineStatus.Qualified"/> sets.
/// </summary>
/// <remarks>
/// See: https://github.com/ppy/osu-web/blob/93930cd02cfbd49724929912597c727c9fbadcd1/app/Models/Beatmapset.php#L155
/// </remarks>
BeatmapSetHypeStatus? HypeStatus { get; }
/// <summary>
/// Contains the current nomination status of the beatmap set.
/// </summary>
BeatmapSetNominationStatus? NominationStatus { get; }
}
}

View File

@ -62,6 +62,12 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"track_id")]
public int? TrackId { get; set; }
[JsonProperty(@"hype")]
public BeatmapSetHypeStatus? HypeStatus { get; set; }
[JsonProperty(@"nominations_summary")]
public BeatmapSetNominationStatus? NominationStatus { get; set; }
public string Title { get; set; } = string.Empty;
[JsonProperty("title_unicode")]