mirror of
https://github.com/yawaflua/SkinsApi.git
synced 2025-12-09 03:49:32 +02:00
Add ping controller and cleaning code
This commit is contained in:
@@ -3,15 +3,12 @@ using SkinsApi.Interfaces.SkinService;
|
||||
using SkinsApi.Models;
|
||||
using SkinsApi.Models.SkinService;
|
||||
using SkinsApi.Sources;
|
||||
using System.Buffers.Text;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SkinsApi.Services
|
||||
{
|
||||
public class SkinService (HttpClient client): ISkinService
|
||||
public class SkinService(HttpClient client) : ISkinService
|
||||
{
|
||||
private async Task<IProfile> GetProfileByNicknameAsync(string nickname)
|
||||
{
|
||||
@@ -37,12 +34,12 @@ namespace SkinsApi.Services
|
||||
return JsonSerializer.Deserialize<DecodedSkinProperty>(decodedString);
|
||||
}
|
||||
public async Task<Skin> GetSkinStreamAsync(string data)
|
||||
{
|
||||
{
|
||||
var uuid = await GetUuidFromDeparsedData(data);
|
||||
var skinproperty = await GetSkinProperty(uuid);
|
||||
var rq = await client.GetAsync(skinproperty.Textures.SKIN.Url);
|
||||
return new Skin(rq.Content.ReadAsStream(), skinproperty.Textures.SKIN.Metadata?.Model == "slim");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user