aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Application/Management/ManagementService.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-07-10 23:51:16 -0500
committerJP Dillingham <jpdillingham@gmail.com>2021-07-10 23:51:16 -0500
commitde48f04b36c784061fd26bc47adaf244c0b8dfe8 (patch)
tree8635a6f8cd2a7f2acaf5871d09d77c809317995a /src/slskd/Application/Management/ManagementService.cs
parentc67223f7b4d4c9f8baa80a9dbf48c8fd69c4c2eb (diff)
downloadslskd-de48f04b36c784061fd26bc47adaf244c0b8dfe8.tar.gz
add GetOptions()
Diffstat (limited to 'src/slskd/Application/Management/ManagementService.cs')
-rw-r--r--src/slskd/Application/Management/ManagementService.cs21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/slskd/Application/Management/ManagementService.cs b/src/slskd/Application/Management/ManagementService.cs
index 84935879..4a385cff 100644
--- a/src/slskd/Application/Management/ManagementService.cs
+++ b/src/slskd/Application/Management/ManagementService.cs
@@ -35,12 +35,20 @@ namespace slskd.Management
Microsoft.Extensions.Options.IOptionsMonitor<Options> optionsMonitor,
ISoulseekClient soulseekClient)
{
- Options = optionsMonitor.CurrentValue;
+ OptionsMonitor = optionsMonitor;
Client = soulseekClient;
}
private ISoulseekClient Client { get; }
- private Options Options { get; }
+ private Options Options => OptionsMonitor.CurrentValue;
+ private Microsoft.Extensions.Options.IOptionsMonitor<Options> OptionsMonitor { get; }
+
+ /// <summary>
+ /// Connects the Soulseek client to the server using the configured username and password.
+ /// </summary>
+ /// <returns>The operation context.</returns>
+ public Task ConnectServerAsync()
+ => Client.ConnectAsync(Options.Soulseek.Username, Options.Soulseek.Password);
/// <summary>
/// Disconnects the Soulseek client from the server.
@@ -51,11 +59,10 @@ namespace slskd.Management
=> Client.Disconnect(message, exception ?? new IntentionalDisconnectException(message));
/// <summary>
- /// Connects the Soulseek client to the server using the configured username and password.
+ /// Gets the current application options.
/// </summary>
- /// <returns>The operation context.</returns>
- public Task ConnectServerAsync()
- => Client.ConnectAsync(Options.Soulseek.Username, Options.Soulseek.Password);
+ /// <returns></returns>
+ public Options GetOptions() => Options;
/// <summary>
/// Gets the current state of the connection to the Soulseek server.
@@ -70,4 +77,4 @@ namespace slskd.Management
Username = Client.Username,
};
}
-}
+} \ No newline at end of file