mirror of
https://github.com/Stone-Red-Code/HyperbolicDownloader.git
synced 2026-09-08 23:41:05 +02:00
Add directory watcher functionality
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace HyperbolicDownloaderApi.Managment;
|
||||
namespace HyperbolicDownloaderApi.Managment;
|
||||
|
||||
public static class ApiConfiguration
|
||||
{
|
||||
public const int BroadcastPort = 2155;
|
||||
public const int PrivatePort = 3055;
|
||||
public static int PublicPort { get; set; }
|
||||
public static string BasePath { get; } = Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location) ?? string.Empty;
|
||||
public static string BasePath { get; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "StoneRed", "HyperbolicDownloader");
|
||||
public static string HostsFilePath { get; } = Path.Combine(BasePath, "Hosts.json");
|
||||
public static string FilesInfoPath { get; } = Path.Combine(BasePath, "Files.json");
|
||||
public static string DirectoriesInfoPath { get; } = Path.Combine(BasePath, "Directories.json");
|
||||
}
|
||||
@@ -21,10 +21,12 @@ public class ApiManager
|
||||
public static IPAddress? PublicIpAddress => device?.GetExternalIPAsync().GetAwaiter().GetResult();
|
||||
public FilesManager FilesManager { get; } = new();
|
||||
public HostsManager HostsManager { get; } = new();
|
||||
public DirectoryWatcher DirectoryWatcher { get; }
|
||||
|
||||
public ApiManager()
|
||||
{
|
||||
networkClient = new(FilesManager);
|
||||
DirectoryWatcher = new(FilesManager);
|
||||
}
|
||||
|
||||
public static NetworkSocket? GetLocalSocket()
|
||||
|
||||
Reference in New Issue
Block a user