Add new beatmap search filter row "General"

This commit is contained in:
Max Hübner
2021-03-25 23:20:10 +01:00
parent 452e5c7cc3
commit aa2c1ee85e
4 changed files with 33 additions and 0 deletions

View File

@ -15,6 +15,9 @@ namespace osu.Game.Online.API.Requests
{
public class SearchBeatmapSetsRequest : APIRequest<SearchBeatmapSetsResponse>
{
[CanBeNull]
public IReadOnlyCollection<SearchGeneral> General { get; }
public SearchCategory SearchCategory { get; }
public SortCriteria SortCriteria { get; }
@ -45,6 +48,7 @@ namespace osu.Game.Online.API.Requests
string query,
RulesetInfo ruleset,
Cursor cursor = null,
IReadOnlyCollection<SearchGeneral> general = null,
SearchCategory searchCategory = SearchCategory.Any,
SortCriteria sortCriteria = SortCriteria.Ranked,
SortDirection sortDirection = SortDirection.Descending,
@ -59,6 +63,7 @@ namespace osu.Game.Online.API.Requests
this.ruleset = ruleset;
this.cursor = cursor;
General = general;
SearchCategory = searchCategory;
SortCriteria = sortCriteria;
SortDirection = sortDirection;
@ -75,6 +80,9 @@ namespace osu.Game.Online.API.Requests
var req = base.CreateWebRequest();
req.AddParameter("q", query);
if (General != null && General.Any())
req.AddParameter("c", string.Join('.', General.Select(e => e.ToString().ToLowerInvariant())));
if (ruleset.ID.HasValue)
req.AddParameter("m", ruleset.ID.Value.ToString());