mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Add ability to set extra parameters to SearchBeatmapSetsRequest
This commit is contained in:
@ -21,6 +21,8 @@ namespace osu.Game.Online.API.Requests
|
|||||||
|
|
||||||
public SearchLanguage Language { get; }
|
public SearchLanguage Language { get; }
|
||||||
|
|
||||||
|
public SearchExtra Extra { get; }
|
||||||
|
|
||||||
private readonly string query;
|
private readonly string query;
|
||||||
private readonly RulesetInfo ruleset;
|
private readonly RulesetInfo ruleset;
|
||||||
private readonly Cursor cursor;
|
private readonly Cursor cursor;
|
||||||
@ -35,7 +37,8 @@ namespace osu.Game.Online.API.Requests
|
|||||||
SortCriteria sortCriteria = SortCriteria.Ranked,
|
SortCriteria sortCriteria = SortCriteria.Ranked,
|
||||||
SortDirection sortDirection = SortDirection.Descending,
|
SortDirection sortDirection = SortDirection.Descending,
|
||||||
SearchGenre genre = SearchGenre.Any,
|
SearchGenre genre = SearchGenre.Any,
|
||||||
SearchLanguage language = SearchLanguage.Any)
|
SearchLanguage language = SearchLanguage.Any,
|
||||||
|
SearchExtra extra = SearchExtra.Any)
|
||||||
{
|
{
|
||||||
this.query = string.IsNullOrEmpty(query) ? string.Empty : System.Uri.EscapeDataString(query);
|
this.query = string.IsNullOrEmpty(query) ? string.Empty : System.Uri.EscapeDataString(query);
|
||||||
this.ruleset = ruleset;
|
this.ruleset = ruleset;
|
||||||
@ -46,6 +49,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
SortDirection = sortDirection;
|
SortDirection = sortDirection;
|
||||||
Genre = genre;
|
Genre = genre;
|
||||||
Language = language;
|
Language = language;
|
||||||
|
Extra = extra;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override WebRequest CreateWebRequest()
|
protected override WebRequest CreateWebRequest()
|
||||||
@ -68,6 +72,28 @@ namespace osu.Game.Online.API.Requests
|
|||||||
|
|
||||||
req.AddCursor(cursor);
|
req.AddCursor(cursor);
|
||||||
|
|
||||||
|
if (Extra != SearchExtra.Any)
|
||||||
|
{
|
||||||
|
string extraString = string.Empty;
|
||||||
|
|
||||||
|
switch (Extra)
|
||||||
|
{
|
||||||
|
case SearchExtra.Both:
|
||||||
|
extraString = "video.storyboard";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SearchExtra.Storyboard:
|
||||||
|
extraString = "storyboard";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SearchExtra.Video:
|
||||||
|
extraString = "video";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
req.AddParameter("e", extraString);
|
||||||
|
}
|
||||||
|
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
osu.Game/Overlays/BeatmapListing/SearchExtra.cs
Normal file
13
osu.Game/Overlays/BeatmapListing/SearchExtra.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.BeatmapListing
|
||||||
|
{
|
||||||
|
public enum SearchExtra
|
||||||
|
{
|
||||||
|
Video,
|
||||||
|
Storyboard,
|
||||||
|
Both,
|
||||||
|
Any
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user