Add Humanizer package

This commit is contained in:
EVAST9919 2017-11-07 12:38:10 +03:00
parent a12052ac51
commit a46dbee532
3 changed files with 49 additions and 15 deletions

View File

@ -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 @@ public class GetUserBeatmapsRequest : APIRequest<List<GetBeatmapSetsResponse>>
{
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

View File

@ -88,6 +88,9 @@
<HintPath>$(SolutionDir)\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Humanizer, Version=2.2.0.0, Culture=neutral, PublicKeyToken=979442b78dfc278e, processorArchitecture=MSIL">
<HintPath>..\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Sqlite, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Microsoft.Data.Sqlite.Core.2.0.0\lib\netstandard2.0\Microsoft.Data.Sqlite.dll</HintPath>
</Reference>

View File

@ -5,6 +5,48 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
-->
<packages>
<package id="DotNetZip" version="1.10.1" targetFramework="net461" />
<package id="Humanizer" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.af" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.ar" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.bg" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.bn-BD" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.cs" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.da" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.de" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.el" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.es" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.fa" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.fi-FI" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.fr" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.fr-BE" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.he" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.hr" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.hu" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.id" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.it" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.ja" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.lv" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.nb" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.nb-NO" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.nl" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.pl" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.pt" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.ro" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.ru" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.sk" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.sl" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.sr" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.sr-Latn" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.sv" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.tr" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.uk" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.uz-Cyrl-UZ" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.uz-Latn-UZ" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.vi" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.zh-CN" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.zh-Hans" version="2.2.0" targetFramework="net461" />
<package id="Humanizer.Core.zh-Hant" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.CSharp" version="4.4.0" targetFramework="net461" />
<package id="Microsoft.Data.Sqlite.Core" version="2.0.0" targetFramework="net461" />
<package id="Microsoft.EntityFrameworkCore" version="2.0.0" targetFramework="net461" />