mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Add Humanizer package
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// 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
|
||||
|
Reference in New Issue
Block a user