From e321494f15c182beec3e8c911341968cbfa73417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8C=E7=A9=BA=E7=99=BD=E3=80=8D?= <「空白」> Date: Wed, 13 May 2020 02:15:24 +0900 Subject: [PATCH] Fix sort-by handling > Add other cursor fields for paging different sortings > Sorted as they show in GUI code-wise for more readability for now --- .../API/Requests/SearchBeatmapSetsRequest.cs | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs index fb2cc66dd8..2987d554af 100644 --- a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs +++ b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs @@ -13,8 +13,29 @@ namespace osu.Game.Online.API.Requests { public class Cursor { + [JsonProperty("title.raw")] + public string Title; + + [JsonProperty("artist.raw")] + public string Artist; + + [JsonProperty("beatmaps.difficultyrating")] + public string Difficulty; + [JsonProperty("approved_date")] - public string ApprovedDate; + public string Ranked; + + [JsonProperty("rating")] + public string Rating; + + [JsonProperty("play_count")] + public string Plays; + + [JsonProperty("favourite_count")] + public string Favourites; + + [JsonProperty("_score")] + public string Relevance; [JsonProperty("_id")] public string Id; @@ -70,8 +91,24 @@ namespace osu.Game.Online.API.Requests if (cursor != null) { + if (cursor.Title != null) + req.AddParameter("cursor[title.raw]", cursor.Title); + if (cursor.Artist != null) + req.AddParameter("cursor[artist.raw]", cursor.Artist); + if (cursor.Difficulty != null) + req.AddParameter("cursor[beatmaps.difficultyrating]", cursor.Difficulty); + if (cursor.Ranked != null) + req.AddParameter("cursor[approved_date]", cursor.Ranked); + if (cursor.Rating != null) + req.AddParameter("cursor[rating]", cursor.Rating); + if (cursor.Plays != null) + req.AddParameter("cursor[play_count]", cursor.Plays); + if (cursor.Favourites != null) + req.AddParameter("cursor[favourite_count]", cursor.Favourites); + if (cursor.Relevance != null) + req.AddParameter("cursor[_score]", cursor.Relevance); + req.AddParameter("cursor[_id]", cursor.Id); - req.AddParameter("cursor[approved_date]", cursor.ApprovedDate); } return req;