diff --git a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs index 7ad3c32bed..66b2cae892 100644 --- a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using Humanizer; using System.Collections.Generic; namespace osu.Game.Online.API.Requests @@ -9,28 +10,16 @@ namespace osu.Game.Online.API.Requests { private readonly long userId; private readonly int offset; - private readonly string type; + private readonly BeatmapSetType type; public GetUserBeatmapsRequest(long userId, BeatmapSetType type, int offset = 0) { this.userId = userId; this.offset = offset; - - switch (type) - { - case BeatmapSetType.Favourite: - this.type = type.ToString().ToLower(); - break; - case BeatmapSetType.MostPlayed: - this.type = "most_played"; - break; - case BeatmapSetType.RankedAndApproved: - this.type = "ranked_and_approved"; - break; - } + this.type = type; } - protected override string Target => $@"users/{userId}/beatmapsets/{type}?offset={offset}"; + protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().Underscore()}?offset={offset}"; } public enum BeatmapSetType diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2388ec4cc2..ef2e573443 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -88,6 +88,9 @@ $(SolutionDir)\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll True + + ..\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll + $(SolutionDir)\packages\Microsoft.Data.Sqlite.Core.2.0.0\lib\netstandard2.0\Microsoft.Data.Sqlite.dll diff --git a/osu.Game/packages.config b/osu.Game/packages.config index ae7b74ef16..02ace918de 100644 --- a/osu.Game/packages.config +++ b/osu.Game/packages.config @@ -5,6 +5,48 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +