mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Merge remote-tracking branch 'origin/master' into subcomments-alter-new
This commit is contained in:
@ -61,6 +61,9 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty(@"failtimes")]
|
||||
private BeatmapMetrics metrics { get; set; }
|
||||
|
||||
[JsonProperty(@"max_combo")]
|
||||
private int? maxCombo { get; set; }
|
||||
|
||||
public BeatmapInfo ToBeatmap(RulesetStore rulesets)
|
||||
{
|
||||
var set = BeatmapSet?.ToBeatmapSet(rulesets);
|
||||
@ -76,6 +79,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
Status = Status,
|
||||
BeatmapSet = set,
|
||||
Metrics = metrics,
|
||||
MaxCombo = maxCombo,
|
||||
BaseDifficulty = new BeatmapDifficulty
|
||||
{
|
||||
DrainRate = drainRate,
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
public class APILegacyUserTopScoreInfo
|
||||
{
|
||||
[JsonProperty(@"position")]
|
||||
public int Position;
|
||||
public int? Position;
|
||||
|
||||
[JsonProperty(@"score")]
|
||||
public APILegacyScoreInfo Score;
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.ComponentModel;
|
||||
using osu.Framework.IO.Network;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Direct;
|
||||
using osu.Game.Rulesets;
|
||||
@ -26,8 +27,21 @@ namespace osu.Game.Online.API.Requests
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
|
||||
protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={searchCategory.ToString().ToLowerInvariant()}&sort={sortCriteria.ToString().ToLowerInvariant()}_{directionString}";
|
||||
protected override WebRequest CreateWebRequest()
|
||||
{
|
||||
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
|
||||
|
@ -2,12 +2,17 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class SearchBeatmapSetsResponse : ResponseWithCursor
|
||||
{
|
||||
[JsonProperty("beatmapsets")]
|
||||
public IEnumerable<APIBeatmapSet> BeatmapSets;
|
||||
|
||||
[JsonProperty("total")]
|
||||
public int Total;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user