aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/slskd/Application/Application.cs8
-rw-r--r--src/slskd/Application/Management/API/Controllers/ApplicationController.cs4
-rw-r--r--src/slskd/Application/Management/API/Controllers/ConfigurationController.cs4
-rw-r--r--src/slskd/Application/Management/API/Controllers/ServerController.cs4
-rw-r--r--src/slskd/Application/Messaging/API/Controllers/ConversationsController.cs4
-rw-r--r--src/slskd/Application/Messaging/API/Controllers/RoomsController.cs4
-rw-r--r--src/slskd/Startup.cs2
-rw-r--r--src/slskd/State.cs (renamed from src/slskd/Application/ApplicationState.cs)4
8 files changed, 17 insertions, 17 deletions
diff --git a/src/slskd/Application/Application.cs b/src/slskd/Application/Application.cs
index 73c82d11..1e5f3584 100644
--- a/src/slskd/Application/Application.cs
+++ b/src/slskd/Application/Application.cs
@@ -45,7 +45,7 @@ namespace slskd
public Application(
OptionsAtStartup optionsAtStartup,
IOptionsMonitor<Options> optionsMonitor,
- IManagedState<ApplicationState> state,
+ IManagedState<State> state,
ITransferTracker transferTracker,
IBrowseTracker browseTracker,
IConversationTracker conversationTracker,
@@ -154,7 +154,7 @@ namespace slskd
private IRoomTracker RoomTracker { get; set; }
private ISharedFileCache SharedFileCache { get; set; }
private DateTime SharesRefreshStarted { get; set; }
- private IManagedState<ApplicationState> State { get; }
+ private IManagedState<State> State { get; }
private ITransferTracker TransferTracker { get; set; }
public Task AcknowledgePrivateMessageAsync(int id) => SoulseekClient.AcknowledgePrivateMessageAsync(id);
@@ -502,7 +502,7 @@ namespace slskd
private void Client_StateChanged(object sender, SoulseekClientStateChangedEventArgs e)
{
- State.SetValue(state => state with { Server = new ServerState() { Address = Client.Address, IPEndPoint = Client.IPEndPoint, State = Client.State, Username = Client.Username } });
+ State.SetValue(state => state with { Server = state.Server with { Address = Client.Address, IPEndPoint = Client.IPEndPoint, State = Client.State, Username = Client.Username } });
}
private void Client_TransferProgressUpdated(object sender, TransferProgressUpdatedEventArgs args)
@@ -844,7 +844,7 @@ namespace slskd
}
}
- private void State_OnChange((ApplicationState Previous, ApplicationState Current) state)
+ private void State_OnChange((State Previous, State Current) state)
{
Logger.Debug("State changed from {Previous} to {Current}", state.Previous.ToJson(), state.Current.ToJson());
}
diff --git a/src/slskd/Application/Management/API/Controllers/ApplicationController.cs b/src/slskd/Application/Management/API/Controllers/ApplicationController.cs
index 8115b3fc..470e5a30 100644
--- a/src/slskd/Application/Management/API/Controllers/ApplicationController.cs
+++ b/src/slskd/Application/Management/API/Controllers/ApplicationController.cs
@@ -37,7 +37,7 @@ namespace slskd.Management.API
public ApplicationController(
IHostApplicationLifetime lifetime,
IApplication application,
- IStateMonitor<ApplicationState> applicationStateMonitor)
+ IStateMonitor<State> applicationStateMonitor)
{
Lifetime = lifetime;
Application = application;
@@ -45,7 +45,7 @@ namespace slskd.Management.API
}
private IApplication Application { get; }
- private IStateMonitor<ApplicationState> ApplicationStateMonitor { get; }
+ private IStateMonitor<State> ApplicationStateMonitor { get; }
private IHostApplicationLifetime Lifetime { get; }
/// <summary>
diff --git a/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs b/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs
index b8c81f84..c28c5c7e 100644
--- a/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs
+++ b/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs
@@ -36,7 +36,7 @@ namespace slskd.Management.API
public ConfigurationController(
IApplication application,
IOptionsSnapshot<Options> optionsShapshot,
- IStateMonitor<ApplicationState> applicationStateMonitor)
+ IStateMonitor<State> applicationStateMonitor)
{
Application = application;
OptionsShapshot = optionsShapshot;
@@ -45,7 +45,7 @@ namespace slskd.Management.API
private IApplication Application { get; }
private IOptionsSnapshot<Options> OptionsShapshot { get; }
- private IStateMonitor<ApplicationState> ApplicationStateMonitor { get; }
+ private IStateMonitor<State> ApplicationStateMonitor { get; }
[HttpGet]
[Route("")]
diff --git a/src/slskd/Application/Management/API/Controllers/ServerController.cs b/src/slskd/Application/Management/API/Controllers/ServerController.cs
index 127b59c0..f929b46e 100644
--- a/src/slskd/Application/Management/API/Controllers/ServerController.cs
+++ b/src/slskd/Application/Management/API/Controllers/ServerController.cs
@@ -33,14 +33,14 @@ namespace slskd.Management.API
{
public ServerController(
IApplication application,
- IStateMonitor<ApplicationState> applicationStateMonitor)
+ IStateMonitor<State> applicationStateMonitor)
{
Application = application;
ApplicationStateMonitor = applicationStateMonitor;
}
private IApplication Application { get; }
- private IStateMonitor<ApplicationState> ApplicationStateMonitor { get; }
+ private IStateMonitor<State> ApplicationStateMonitor { get; }
/// <summary>
/// Connects the client.
diff --git a/src/slskd/Application/Messaging/API/Controllers/ConversationsController.cs b/src/slskd/Application/Messaging/API/Controllers/ConversationsController.cs
index b3c07690..961b8ca8 100644
--- a/src/slskd/Application/Messaging/API/Controllers/ConversationsController.cs
+++ b/src/slskd/Application/Messaging/API/Controllers/ConversationsController.cs
@@ -42,7 +42,7 @@ namespace slskd.Messaging.API
/// <param name="tracker"></param>
public ConversationsController(
IApplication application,
- IStateMonitor<ApplicationState> applicationStateMonotor,
+ IStateMonitor<State> applicationStateMonotor,
IConversationTracker tracker)
{
Application = application;
@@ -51,7 +51,7 @@ namespace slskd.Messaging.API
}
private IApplication Application { get; }
- private IStateMonitor<ApplicationState> ApplicationStateMonitor { get; }
+ private IStateMonitor<State> ApplicationStateMonitor { get; }
private IConversationTracker Tracker { get; }
/// <summary>
diff --git a/src/slskd/Application/Messaging/API/Controllers/RoomsController.cs b/src/slskd/Application/Messaging/API/Controllers/RoomsController.cs
index d7b605d1..07b58f6f 100644
--- a/src/slskd/Application/Messaging/API/Controllers/RoomsController.cs
+++ b/src/slskd/Application/Messaging/API/Controllers/RoomsController.cs
@@ -38,7 +38,7 @@ namespace slskd.Messaging.API
{
public RoomsController(
IApplication application,
- IStateMonitor<ApplicationState> applicationStateMonitor,
+ IStateMonitor<State> applicationStateMonitor,
IRoomTracker tracker)
{
Application = application;
@@ -47,7 +47,7 @@ namespace slskd.Messaging.API
}
private IApplication Application { get; }
- private IStateMonitor<ApplicationState> ApplicationStateMonitor { get; }
+ private IStateMonitor<State> ApplicationStateMonitor { get; }
private IRoomTracker Tracker { get; }
/// <summary>
diff --git a/src/slskd/Startup.cs b/src/slskd/Startup.cs
index 1f6f2878..c03f8603 100644
--- a/src/slskd/Startup.cs
+++ b/src/slskd/Startup.cs
@@ -104,7 +104,7 @@ namespace slskd
return true;
});
- services.AddManagedState<ApplicationState>(state => state with { Version = state.Version with { Current = "9000" } });
+ services.AddManagedState<State>(state => state with { Version = state.Version with { Current = "9000" } });
services.AddCors(options => options.AddPolicy("AllowAll", builder => builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()));
diff --git a/src/slskd/Application/ApplicationState.cs b/src/slskd/State.cs
index c9322eb3..d87761ca 100644
--- a/src/slskd/Application/ApplicationState.cs
+++ b/src/slskd/State.cs
@@ -1,4 +1,4 @@
-// <copyright file="ApplicationState.cs" company="slskd Team">
+// <copyright file="State.cs" company="slskd Team">
// Copyright (c) slskd Team. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
@@ -24,7 +24,7 @@ namespace slskd
/// <summary>
/// Application service state.
/// </summary>
- public record ApplicationState
+ public record State
{
public VersionState Version { get; init; } = new VersionState();
public bool PendingReconnect { get; init; }