From 9dd052f3aceaaabfa1f9981e7ee3020895c10425 Mon Sep 17 00:00:00 2001 From: Shiroechi <29156554+Shiroechi@users.noreply.github.com> Date: Sat, 2 Jan 2021 11:10:30 +0700 Subject: [PATCH] Update Lolibooru.cs --- Booru/Client/Lolibooru.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Booru/Client/Lolibooru.cs b/Booru/Client/Lolibooru.cs index 01f4339..613e038 100644 --- a/Booru/Client/Lolibooru.cs +++ b/Booru/Client/Lolibooru.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Net.Http; using System.Text.Json; @@ -41,12 +42,12 @@ protected override Artist ReadArtist(JsonElement json) urls.Add(item.GetString()); } } - - return new Artist( - uint.Parse(json.GetProperty("id").GetString()), - json.GetProperty("name").GetString(), - urls); - } + return new Artist + { + ID = json.GetProperty("id").GetUInt32(), + Name = json.GetProperty("name").GetString(), + Urls = new ReadOnlyCollection(urls) + }; /// protected override Pool ReadPool(JsonElement json)