Fix download/upload timeout + Fix some warnings

This commit is contained in:
Aurélie Delhaie
2022-08-08 18:00:11 +02:00
parent e3d33a1af9
commit 40645a80a1
28 changed files with 71 additions and 52 deletions

View File

@@ -7,24 +7,27 @@ using System.Text.Json;
namespace OpenSaveCloudClient.Models
{
public class Configuration
public class UserConfiguration
{
private static Configuration? instance;
private static UserConfiguration? instance;
private Dictionary<string, string> _values;
private Configuration()
private UserConfiguration()
{
_values = new Dictionary<string, string>();
Load();
}
public static Configuration GetInstance()
public static UserConfiguration Instance
{
if (instance == null)
get
{
instance = new Configuration();
if (instance == null)
{
instance = new UserConfiguration();
}
return instance;
}
return instance;
}
private void Load()

View File

@@ -7,6 +7,7 @@ using System.Threading.Tasks;
using System.IO.Compression;
using System.Security.Cryptography;
using OpenSaveCloudClient.Core;
using System.Globalization;
namespace OpenSaveCloudClient.Models
{
@@ -96,7 +97,7 @@ namespace OpenSaveCloudClient.Models
byte[]? hashBytes = HashTool.HashDirectory(FolderPath);
if (hashBytes == null)
{
throw new Exception(String.Format("failed to get hash of directory '{0}'", FolderPath));
throw new Exception(message: string.Format(CultureInfo.CurrentCulture, "failed to get hash of directory '{0}'", FolderPath));
}
currentHash = BitConverter.ToString(hashBytes).Replace("-", "");
if (currentHash != hash)