mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Fix + simplify web request
This commit is contained in:
@ -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.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Humanizer;
|
||||||
using osu.Framework.IO.Network;
|
using osu.Framework.IO.Network;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Screens.Multi.Lounge.Components;
|
using osu.Game.Screens.Multi.Lounge.Components;
|
||||||
@ -23,27 +24,11 @@ namespace osu.Game.Online.API.Requests
|
|||||||
{
|
{
|
||||||
var req = base.CreateWebRequest();
|
var req = base.CreateWebRequest();
|
||||||
|
|
||||||
switch (statusFilter)
|
if (statusFilter != RoomStatusFilter.Open)
|
||||||
{
|
req.AddParameter("mode", statusFilter.ToString().Underscore().ToLowerInvariant());
|
||||||
case RoomStatusFilter.Owned:
|
|
||||||
req.AddParameter("mode", "owned");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RoomStatusFilter.Participated:
|
if (categoryFilter != RoomCategoryFilter.Any)
|
||||||
req.AddParameter("mode", "participated");
|
req.AddParameter("category", categoryFilter.ToString().Underscore().ToLowerInvariant());
|
||||||
break;
|
|
||||||
|
|
||||||
case RoomStatusFilter.RecentlyEnded:
|
|
||||||
req.AddParameter("mode", "ended");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (categoryFilter)
|
|
||||||
{
|
|
||||||
case RoomCategoryFilter.Spotlight:
|
|
||||||
req.AddParameter("category", "spotlight");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
Open,
|
Open,
|
||||||
|
|
||||||
[Description("Recently Ended")]
|
[Description("Recently Ended")]
|
||||||
RecentlyEnded,
|
Ended,
|
||||||
Participated,
|
Participated,
|
||||||
Owned,
|
Owned,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user