Skip to content

Commit

Permalink
Add FeaturedInSpotlight property to API beatmapsets
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzibyte committed May 14, 2022
1 parent 6e74244 commit d5027cd
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
17 changes: 12 additions & 5 deletions osu.Game.Tests/Visual/Beatmaps/TestSceneBeatmapCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,26 @@ private void load()
explicitMap.Title = someDifficulties.TitleUnicode = "explicit beatmap";
explicitMap.HasExplicitContent = true;

var spotlightMap = CreateAPIBeatmapSet(Ruleset.Value);
spotlightMap.Title = someDifficulties.TitleUnicode = "spotlight beatmap";
spotlightMap.FeaturedInSpotlight = true;

var featuredMap = CreateAPIBeatmapSet(Ruleset.Value);
featuredMap.Title = someDifficulties.TitleUnicode = "featured artist beatmap";
featuredMap.TrackId = 1;

var explicitFeaturedMap = CreateAPIBeatmapSet(Ruleset.Value);
explicitFeaturedMap.Title = someDifficulties.TitleUnicode = "explicit featured artist";
explicitFeaturedMap.HasExplicitContent = true;
explicitFeaturedMap.TrackId = 2;
var allBadgesMap = CreateAPIBeatmapSet(Ruleset.Value);
allBadgesMap.Title = someDifficulties.TitleUnicode = "all-badges beatmap";
allBadgesMap.HasExplicitContent = true;
allBadgesMap.FeaturedInSpotlight = true;
allBadgesMap.TrackId = 2;

var longName = CreateAPIBeatmapSet(Ruleset.Value);
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.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.FeaturedInSpotlight = true;
longName.TrackId = 444;

testCases = new[]
Expand All @@ -108,8 +114,9 @@ private void load()
someDifficulties,
manyDifficulties,
explicitMap,
spotlightMap,
featuredMap,
explicitFeaturedMap,
allBadgesMap,
longName
};

Expand Down
24 changes: 24 additions & 0 deletions osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ public void TestExplicitBeatmap()
});
}

[Test]
public void TestSpotlightBeatmap()
{
AddStep("show spotlight map", () =>
{
var beatmapSet = getBeatmapSet();
beatmapSet.FeaturedInSpotlight = true;
overlay.ShowBeatmapSet(beatmapSet);
});
}

[Test]
public void TestFeaturedBeatmap()
{
Expand All @@ -176,6 +187,19 @@ public void TestFeaturedBeatmap()
});
}

[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]
public void TestHide()
{
Expand Down
3 changes: 3 additions & 0 deletions osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class APIBeatmapSet : IBeatmapSetOnlineInfo, IBeatmapSetInfo
[JsonProperty(@"nsfw")]
public bool HasExplicitContent { get; set; }

[JsonProperty(@"spotlight")]
public bool FeaturedInSpotlight { get; set; }

[JsonProperty(@"video")]
public bool HasVideo { get; set; }

Expand Down

0 comments on commit d5027cd

Please sign in to comment.