1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 19:32:55 +08:00

Add FeaturedInSpotlight property to API beatmapsets

This commit is contained in:
Salman Ahmed 2022-05-14 19:46:13 +03:00
parent 6e74244022
commit d5027cdfbd
3 changed files with 39 additions and 5 deletions

View File

@ -84,20 +84,26 @@ namespace osu.Game.Tests.Visual.Beatmaps
explicitMap.Title = someDifficulties.TitleUnicode = "explicit beatmap"; explicitMap.Title = someDifficulties.TitleUnicode = "explicit beatmap";
explicitMap.HasExplicitContent = true; explicitMap.HasExplicitContent = true;
var spotlightMap = CreateAPIBeatmapSet(Ruleset.Value);
spotlightMap.Title = someDifficulties.TitleUnicode = "spotlight beatmap";
spotlightMap.FeaturedInSpotlight = true;
var featuredMap = CreateAPIBeatmapSet(Ruleset.Value); var featuredMap = CreateAPIBeatmapSet(Ruleset.Value);
featuredMap.Title = someDifficulties.TitleUnicode = "featured artist beatmap"; featuredMap.Title = someDifficulties.TitleUnicode = "featured artist beatmap";
featuredMap.TrackId = 1; featuredMap.TrackId = 1;
var explicitFeaturedMap = CreateAPIBeatmapSet(Ruleset.Value); var allBadgesMap = CreateAPIBeatmapSet(Ruleset.Value);
explicitFeaturedMap.Title = someDifficulties.TitleUnicode = "explicit featured artist"; allBadgesMap.Title = someDifficulties.TitleUnicode = "all-badges beatmap";
explicitFeaturedMap.HasExplicitContent = true; allBadgesMap.HasExplicitContent = true;
explicitFeaturedMap.TrackId = 2; allBadgesMap.FeaturedInSpotlight = true;
allBadgesMap.TrackId = 2;
var longName = CreateAPIBeatmapSet(Ruleset.Value); var longName = CreateAPIBeatmapSet(Ruleset.Value);
longName.Title = longName.TitleUnicode = "this track has an incredibly and implausibly long title"; longName.Title = longName.TitleUnicode = "this track has an incredibly and implausibly long title";
longName.Artist = longName.ArtistUnicode = "and this artist! who would have thunk it. it's really such a long name."; longName.Artist = longName.ArtistUnicode = "and this artist! who would have thunk it. it's really such a long name.";
longName.Source = "wow. even the source field has an impossibly long string in it. this really takes the cake, doesn't it?"; longName.Source = "wow. even the source field has an impossibly long string in it. this really takes the cake, doesn't it?";
longName.HasExplicitContent = true; longName.HasExplicitContent = true;
longName.FeaturedInSpotlight = true;
longName.TrackId = 444; longName.TrackId = 444;
testCases = new[] testCases = new[]
@ -108,8 +114,9 @@ namespace osu.Game.Tests.Visual.Beatmaps
someDifficulties, someDifficulties,
manyDifficulties, manyDifficulties,
explicitMap, explicitMap,
spotlightMap,
featuredMap, featuredMap,
explicitFeaturedMap, allBadgesMap,
longName longName
}; };

View File

@ -165,6 +165,17 @@ namespace osu.Game.Tests.Visual.Online
}); });
} }
[Test]
public void TestSpotlightBeatmap()
{
AddStep("show spotlight map", () =>
{
var beatmapSet = getBeatmapSet();
beatmapSet.FeaturedInSpotlight = true;
overlay.ShowBeatmapSet(beatmapSet);
});
}
[Test] [Test]
public void TestFeaturedBeatmap() public void TestFeaturedBeatmap()
{ {
@ -176,6 +187,19 @@ namespace osu.Game.Tests.Visual.Online
}); });
} }
[Test]
public void TestAllBadgesBeatmap()
{
AddStep("show map with all badges", () =>
{
var beatmapSet = getBeatmapSet();
beatmapSet.HasExplicitContent = true;
beatmapSet.FeaturedInSpotlight = true;
beatmapSet.TrackId = 1;
overlay.ShowBeatmapSet(beatmapSet);
});
}
[Test] [Test]
public void TestHide() public void TestHide()
{ {

View File

@ -42,6 +42,9 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"nsfw")] [JsonProperty(@"nsfw")]
public bool HasExplicitContent { get; set; } public bool HasExplicitContent { get; set; }
[JsonProperty(@"spotlight")]
public bool FeaturedInSpotlight { get; set; }
[JsonProperty(@"video")] [JsonProperty(@"video")]
public bool HasVideo { get; set; } public bool HasVideo { get; set; }