Upgrade project to .NET 8

This commit is contained in:
Stone_Red
2023-12-14 19:00:47 +01:00
parent 9de227050a
commit 30ce61cc41
20 changed files with 53 additions and 137 deletions
@@ -9,7 +9,7 @@ public class DirectoryWatcher
{
private readonly FilesManager filesManager;
private readonly List<string> directories = new();
private readonly List<string> directories = [];
private readonly System.Timers.Timer timer = new(1);
public DirectoryWatcher(FilesManager filesManager)
@@ -7,7 +7,7 @@ namespace HyperbolicDownloaderApi.FileProcessing;
public class FilesManager
{
private readonly List<PrivateHyperFileInfo> files = new List<PrivateHyperFileInfo>();
private readonly List<PrivateHyperFileInfo> files = [];
public bool TryAdd(string filePath, out PrivateHyperFileInfo? fileInfo, out string? errorMessage)
{
@@ -95,7 +95,7 @@ public class FilesManager
public List<PrivateHyperFileInfo> ToList()
{
return files.ToList();
return [.. files];
}
internal void RemoveFilesThatDontExist()
@@ -1,13 +1,7 @@
namespace HyperbolicDownloaderApi.FileProcessing;
public class PrivateHyperFileInfo
public class PrivateHyperFileInfo(string hash, string filePath)
{
public string Hash { get; set; }
public string FilePath { get; set; }
public PrivateHyperFileInfo(string hash, string filePath)
{
Hash = hash;
FilePath = filePath;
}
public string Hash { get; set; } = hash;
public string FilePath { get; set; } = filePath;
}
@@ -5,7 +5,7 @@ namespace HyperbolicDownloaderApi.FileProcessing;
public class PublicHyperFileInfo
{
public string Hash { get; set; } = string.Empty;
public List<NetworkSocket> Hosts { get; set; } = new();
public List<NetworkSocket> Hosts { get; set; } = [];
public PublicHyperFileInfo()
{