mirror of
https://github.com/Stone-Red-Code/HyperbolicDownloader.git
synced 2026-09-07 07:46:22 +02:00
Upgrade project to .NET 8
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user