diff --git a/StabilityMatrix/App.xaml.cs b/StabilityMatrix/App.xaml.cs index 6aea9972..3665af0b 100644 --- a/StabilityMatrix/App.xaml.cs +++ b/StabilityMatrix/App.xaml.cs @@ -247,9 +247,7 @@ namespace StabilityMatrix }); // Add Refit clients - // @NuarkNoir: When passing config to this method we are loosing sizeKB from response, who knows why. - // @NuarkNoit: Another solution, anyone? - serviceCollection.AddRefitClient() + serviceCollection.AddRefitClient(defaultRefitSettings) .ConfigureHttpClient(c => { c.BaseAddress = new Uri("https://civitai.com"); diff --git a/StabilityMatrix/Models/Api/CivitFile.cs b/StabilityMatrix/Models/Api/CivitFile.cs index 626f2e30..01d2fd7f 100644 --- a/StabilityMatrix/Models/Api/CivitFile.cs +++ b/StabilityMatrix/Models/Api/CivitFile.cs @@ -5,7 +5,7 @@ namespace StabilityMatrix.Models.Api; public class CivitFile { - [JsonPropertyName("sizeKb")] + [JsonPropertyName("sizeKB")] public double SizeKb { get; set; } [JsonPropertyName("pickleScanResult")] diff --git a/StabilityMatrix/Models/FileSizeType.cs b/StabilityMatrix/Models/FileSizeType.cs index 98dd7b5b..9edcf63b 100644 --- a/StabilityMatrix/Models/FileSizeType.cs +++ b/StabilityMatrix/Models/FileSizeType.cs @@ -1,23 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Collections.ObjectModel; -using System.Diagnostics; -using System.Drawing; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Security.Policy; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media.Imaging; -using System.Windows.Threading; -using AsyncAwaitBestPractices; -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; -using NLog; -using StabilityMatrix.Extensions; -using StabilityMatrix.Helper; +using System.Globalization; namespace StabilityMatrix.Models; @@ -35,9 +16,9 @@ public class FileSizeType private string ConvertToHumanReadable() { - string[] sizeUnits = { "KB", "MB", "GB", "TB" }; - double size = SizeInKB; - int unitIndex = 0; + var sizeUnits = new string[] { "KB", "MB", "GB", "TB" }; + var size = SizeInKB; + var unitIndex = 0; while (size >= 1024 && unitIndex < sizeUnits.Length - 1) {