diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-09-10 18:21:23 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-09-10 18:21:23 -0500 |
| commit | acd293a58a8efe20f98d8702d4823fae5ef81316 (patch) | |
| tree | a124a6c8c515db1f0ad68f1f4093a016a36bebfc /src/slskd/Application/Application.cs | |
| parent | 583325356493c0123a6410e6aa34e60bf148f219 (diff) | |
| download | slskd-acd293a58a8efe20f98d8702d4823fae5ef81316.tar.gz | |
remove I/ManagementService
Diffstat (limited to 'src/slskd/Application/Application.cs')
| -rw-r--r-- | src/slskd/Application/Application.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/slskd/Application/Application.cs b/src/slskd/Application/Application.cs index 6b95c779..fb521fdb 100644 --- a/src/slskd/Application/Application.cs +++ b/src/slskd/Application/Application.cs @@ -244,6 +244,27 @@ namespace slskd } } + /// <summary> + /// Connects the Soulseek client to the server using the configured username and password. + /// </summary> + /// <returns>The operation context.</returns> + public Task ConnectAsync() + => Client.ConnectAsync(Options.Soulseek.Username, Options.Soulseek.Password); + + /// <summary> + /// Disconnects the Soulseek client from the server. + /// </summary> + /// <param name="message">An optional message containing the reason for the disconnect.</param> + /// <param name="exception">An optional Exception to associate with the disconnect.</param> + public void Disconnect(string message = null, Exception exception = null) + => Client.Disconnect(message, exception ?? new IntentionalDisconnectException(message)); + + /// <summary> + /// Re-scans shared directories. + /// </summary> + /// <returns>The operation context.</returns> + public Task RescanSharesAsync() => SharedFileCache.FillAsync(); + private async Task OptionsMonitor_OnChange(Options newOptions) { // this code is known to fire more than once per update. i'm not sure |
