Browse Source

Applied requested changes to codestyle

pull/4/head
Andrew nuark G 1 year ago
parent
commit
2cff40476f
  1. 4
      StabilityMatrix/App.xaml.cs
  2. 2
      StabilityMatrix/Models/Api/CivitFile.cs
  3. 27
      StabilityMatrix/Models/FileSizeType.cs

4
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<ICivitApi>()
serviceCollection.AddRefitClient<ICivitApi>(defaultRefitSettings)
.ConfigureHttpClient(c =>
{
c.BaseAddress = new Uri("https://civitai.com");

2
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")]

27
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)
{

Loading…
Cancel
Save