mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 01:37:46 +08:00
Adjust SearchBeatmapSetsRequest for new usage
This commit is contained in:
parent
01202f09be
commit
255c8d3a13
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using osu.Framework.IO.Network;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Direct;
|
using osu.Game.Overlays.Direct;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
@ -26,8 +27,21 @@ namespace osu.Game.Online.API.Requests
|
|||||||
this.direction = direction;
|
this.direction = direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
|
protected override WebRequest CreateWebRequest()
|
||||||
protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={searchCategory.ToString().ToLowerInvariant()}&sort={sortCriteria.ToString().ToLowerInvariant()}_{directionString}";
|
{
|
||||||
|
var req = base.CreateWebRequest();
|
||||||
|
req.AddParameter("q", query);
|
||||||
|
|
||||||
|
if (ruleset.ID.HasValue)
|
||||||
|
req.AddParameter("m", ruleset.ID.Value.ToString());
|
||||||
|
|
||||||
|
req.AddParameter("s", searchCategory.ToString().ToLowerInvariant());
|
||||||
|
req.AddParameter("sort", $"{sortCriteria.ToString().ToLowerInvariant()}_{directionString}");
|
||||||
|
|
||||||
|
return req;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override string Target => @"beatmapsets/search";
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum BeatmapSearchCategory
|
public enum BeatmapSearchCategory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user