diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-09-20 09:28:34 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-09-20 09:28:34 -0500 |
| commit | b6463178e3f4679386b57614806d148bbc9b883f (patch) | |
| tree | 0dc83f47800677731cf6db1d0ebf54724c2869b1 /src | |
| parent | 8b015940c0386c119a2b83a55c80fa1fc0de2ff1 (diff) | |
| download | slskd-b6463178e3f4679386b57614806d148bbc9b883f.tar.gz | |
move stuff around
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Application/Core/API/Controllers/ApplicationController.cs (renamed from src/slskd/Application/Management/API/Controllers/ApplicationController.cs) | 2 | ||||
| -rw-r--r-- | src/slskd/Application/Core/API/Controllers/ConfigurationController.cs (renamed from src/slskd/Application/Management/API/Controllers/ConfigurationController.cs) | 3 | ||||
| -rw-r--r-- | src/slskd/Application/Core/API/Controllers/OptionsController.cs (renamed from src/slskd/Application/Management/API/Controllers/OptionsController.cs) | 2 | ||||
| -rw-r--r-- | src/slskd/Application/Core/API/Controllers/ServerController.cs (renamed from src/slskd/Application/Management/API/Controllers/ServerController.cs) | 2 | ||||
| -rw-r--r-- | src/slskd/Application/Core/API/Controllers/SessionController.cs (renamed from src/slskd/Application/Management/API/Controllers/SessionController.cs) | 2 | ||||
| -rw-r--r-- | src/slskd/Application/Core/API/DTO/LoginRequest.cs (renamed from src/slskd/Application/Management/API/DTO/LoginRequest.cs) | 2 | ||||
| -rw-r--r-- | src/slskd/Application/Core/API/DTO/ServerState.cs (renamed from src/slskd/Application/Management/API/DTO/ServerState.cs) | 2 | ||||
| -rw-r--r-- | src/slskd/Application/Core/API/DTO/TokenResponse.cs (renamed from src/slskd/Application/Management/API/DTO/TokenResponse.cs) | 2 | ||||
| -rw-r--r-- | src/slskd/Application/Core/API/Hubs/ApplicationHub.cs (renamed from src/slskd/Application/Hub.cs) | 10 | ||||
| -rw-r--r-- | src/slskd/Application/Core/Application.cs (renamed from src/slskd/Application/Application.cs) | 14 | ||||
| -rw-r--r-- | src/slskd/Application/Shares/SharedFileCache.cs (renamed from src/slskd/Application/SharedFileCache.cs) | 2 | ||||
| -rw-r--r-- | src/slskd/Common/UserEndPointCache.cs (renamed from src/slskd/Application/UserEndPointCache.cs) | 0 | ||||
| -rw-r--r-- | src/slskd/Exceptions/ApplicationShutdownException.cs (renamed from src/slskd/Application/Exceptions/ApplicationShutdownException.cs) | 0 | ||||
| -rw-r--r-- | src/slskd/Exceptions/IntentionalDisconnectException.cs (renamed from src/slskd/Application/Exceptions/IntentionalDisconnectException.cs) | 0 | ||||
| -rw-r--r-- | src/slskd/Exceptions/RetryException.cs (renamed from src/slskd/Application/Exceptions/RetryException.cs) | 0 | ||||
| -rw-r--r-- | src/slskd/Exceptions/ShareAliasException.cs (renamed from src/slskd/Application/Exceptions/ShareAliasException.cs) | 0 | ||||
| -rw-r--r-- | src/slskd/Exceptions/ShareScanInProgressException.cs (renamed from src/slskd/Application/Exceptions/ShareScanInProgressException.cs) | 0 | ||||
| -rw-r--r-- | src/slskd/Exceptions/SlskdException.cs (renamed from src/slskd/Application/Exceptions/SlskdException.cs) | 0 | ||||
| -rw-r--r-- | src/slskd/Startup.cs | 5 |
19 files changed, 26 insertions, 22 deletions
diff --git a/src/slskd/Application/Management/API/Controllers/ApplicationController.cs b/src/slskd/Application/Core/API/Controllers/ApplicationController.cs index 470e5a30..16cd68b9 100644 --- a/src/slskd/Application/Management/API/Controllers/ApplicationController.cs +++ b/src/slskd/Application/Core/API/Controllers/ApplicationController.cs @@ -15,7 +15,7 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> -namespace slskd.Management.API +namespace slskd.Core.API { using System; using System.Diagnostics; diff --git a/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs b/src/slskd/Application/Core/API/Controllers/ConfigurationController.cs index c28c5c7e..01c8bbc1 100644 --- a/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs +++ b/src/slskd/Application/Core/API/Controllers/ConfigurationController.cs @@ -17,11 +17,10 @@ using Microsoft.Extensions.Options; -namespace slskd.Management.API +namespace slskd.Core.API { using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; - using slskd.Management; /// <summary> /// Configuration. diff --git a/src/slskd/Application/Management/API/Controllers/OptionsController.cs b/src/slskd/Application/Core/API/Controllers/OptionsController.cs index 6f6275d1..fb2057b9 100644 --- a/src/slskd/Application/Management/API/Controllers/OptionsController.cs +++ b/src/slskd/Application/Core/API/Controllers/OptionsController.cs @@ -17,7 +17,7 @@ using Microsoft.Extensions.Options; -namespace slskd.Management.API +namespace slskd.Core.API { using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/src/slskd/Application/Management/API/Controllers/ServerController.cs b/src/slskd/Application/Core/API/Controllers/ServerController.cs index e3199d78..172333ec 100644 --- a/src/slskd/Application/Management/API/Controllers/ServerController.cs +++ b/src/slskd/Application/Core/API/Controllers/ServerController.cs @@ -17,7 +17,7 @@ using Microsoft.Extensions.Options; -namespace slskd.Management.API +namespace slskd.Core.API { using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; diff --git a/src/slskd/Application/Management/API/Controllers/SessionController.cs b/src/slskd/Application/Core/API/Controllers/SessionController.cs index a9ae0188..5f20aa9f 100644 --- a/src/slskd/Application/Management/API/Controllers/SessionController.cs +++ b/src/slskd/Application/Core/API/Controllers/SessionController.cs @@ -17,7 +17,7 @@ using Microsoft.Extensions.Options; -namespace slskd.Management.API +namespace slskd.Core.API { using System; using System.Collections.Generic; diff --git a/src/slskd/Application/Management/API/DTO/LoginRequest.cs b/src/slskd/Application/Core/API/DTO/LoginRequest.cs index d4b8dd75..0653847d 100644 --- a/src/slskd/Application/Management/API/DTO/LoginRequest.cs +++ b/src/slskd/Application/Core/API/DTO/LoginRequest.cs @@ -15,7 +15,7 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> -namespace slskd.Management.API +namespace slskd.Core.API { public class LoginRequest { diff --git a/src/slskd/Application/Management/API/DTO/ServerState.cs b/src/slskd/Application/Core/API/DTO/ServerState.cs index 80c1e856..5dd16365 100644 --- a/src/slskd/Application/Management/API/DTO/ServerState.cs +++ b/src/slskd/Application/Core/API/DTO/ServerState.cs @@ -15,7 +15,7 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> -namespace slskd.Management +namespace slskd.Core { using System.Net; using Soulseek; diff --git a/src/slskd/Application/Management/API/DTO/TokenResponse.cs b/src/slskd/Application/Core/API/DTO/TokenResponse.cs index 21508b81..85992917 100644 --- a/src/slskd/Application/Management/API/DTO/TokenResponse.cs +++ b/src/slskd/Application/Core/API/DTO/TokenResponse.cs @@ -15,7 +15,7 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> -namespace slskd.Management.API +namespace slskd.Core.API { using System; using System.IdentityModel.Tokens.Jwt; diff --git a/src/slskd/Application/Hub.cs b/src/slskd/Application/Core/API/Hubs/ApplicationHub.cs index 0112bcb2..be6c2fe7 100644 --- a/src/slskd/Application/Hub.cs +++ b/src/slskd/Application/Core/API/Hubs/ApplicationHub.cs @@ -1,4 +1,4 @@ -// <copyright file="Hub.cs" company="slskd Team"> +// <copyright file="ApplicationHub.cs" company="slskd Team"> // Copyright (c) slskd Team. All rights reserved. // // This program is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> -namespace slskd +namespace slskd.Core { using System.Threading.Tasks; using Microsoft.AspNetCore.SignalR; @@ -23,7 +23,7 @@ namespace slskd /// <summary> /// Extension methods for the application SignalR hub. /// </summary> - public static class HubExtensions + public static class ApplicationHubExtensions { /// <summary> /// Broadcast the present application state. @@ -31,7 +31,7 @@ namespace slskd /// <param name="hub">The hub.</param> /// <param name="state">The state to broadcast.</param> /// <returns>The operation context.</returns> - public static Task BroadcastStateAsync(this IHubContext<Hub> hub, State state) + public static Task BroadcastStateAsync(this IHubContext<ApplicationHub> hub, State state) { return hub.Clients.All.SendAsync(Methods.State, state); } @@ -45,7 +45,7 @@ namespace slskd /// <summary> /// The application SignalR hub. /// </summary> - public class Hub : Microsoft.AspNetCore.SignalR.Hub + public class ApplicationHub : Hub { } }
\ No newline at end of file diff --git a/src/slskd/Application/Application.cs b/src/slskd/Application/Core/Application.cs index 97294164..56eac586 100644 --- a/src/slskd/Application/Application.cs +++ b/src/slskd/Application/Core/Application.cs @@ -15,7 +15,9 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> -namespace slskd +using Microsoft.Extensions.Options; + +namespace slskd.Core { using System; using System.Collections.Concurrent; @@ -27,13 +29,13 @@ namespace slskd using System.Threading.Tasks; using Microsoft.AspNetCore.SignalR; using Microsoft.Extensions.Hosting; - using Microsoft.Extensions.Options; using Serilog; using Serilog.Events; using slskd.Configuration; using slskd.Integrations.Pushbullet; using slskd.Messaging; using slskd.Search; + using slskd.Shares; using slskd.Transfers; using slskd.Users; using Soulseek; @@ -61,7 +63,7 @@ namespace slskd IRoomService roomService, ISharedFileCache sharedFileCache, IPushbulletService pushbulletService, - IHubContext<Hub> hubContext) + IHubContext<ApplicationHub> applicationHub) { OptionsAtStartup = optionsAtStartup; @@ -82,7 +84,7 @@ namespace slskd Pushbullet = pushbulletService; RoomService = roomService; - HubContext = hubContext; + ApplicationHub = applicationHub; Client = soulseekClient; @@ -124,7 +126,7 @@ namespace slskd private DateTime SharesRefreshStarted { get; set; } private IManagedState<State> State { get; } private ITransferTracker TransferTracker { get; set; } - private IHubContext<Hub> HubContext { get; set; } + private IHubContext<ApplicationHub> ApplicationHub { get; set; } /// <summary> /// Gets the version of the latest application release. @@ -732,7 +734,7 @@ namespace slskd private void State_OnChange((State Previous, State Current) state) { Logger.Debug("State changed from {Previous} to {Current}", state.Previous.ToJson(), state.Current.ToJson()); - HubContext.BroadcastStateAsync(state.Current); + ApplicationHub.BroadcastStateAsync(state.Current); } /// <summary> diff --git a/src/slskd/Application/SharedFileCache.cs b/src/slskd/Application/Shares/SharedFileCache.cs index 71d1bae1..062a059c 100644 --- a/src/slskd/Application/SharedFileCache.cs +++ b/src/slskd/Application/Shares/SharedFileCache.cs @@ -18,7 +18,7 @@ using System.IO; using Microsoft.Extensions.Options; -namespace slskd +namespace slskd.Shares { using System; using System.Collections.Concurrent; diff --git a/src/slskd/Application/UserEndPointCache.cs b/src/slskd/Common/UserEndPointCache.cs index 29164cc4..29164cc4 100644 --- a/src/slskd/Application/UserEndPointCache.cs +++ b/src/slskd/Common/UserEndPointCache.cs diff --git a/src/slskd/Application/Exceptions/ApplicationShutdownException.cs b/src/slskd/Exceptions/ApplicationShutdownException.cs index e30b5c79..e30b5c79 100644 --- a/src/slskd/Application/Exceptions/ApplicationShutdownException.cs +++ b/src/slskd/Exceptions/ApplicationShutdownException.cs diff --git a/src/slskd/Application/Exceptions/IntentionalDisconnectException.cs b/src/slskd/Exceptions/IntentionalDisconnectException.cs index d5293e63..d5293e63 100644 --- a/src/slskd/Application/Exceptions/IntentionalDisconnectException.cs +++ b/src/slskd/Exceptions/IntentionalDisconnectException.cs diff --git a/src/slskd/Application/Exceptions/RetryException.cs b/src/slskd/Exceptions/RetryException.cs index c688f377..c688f377 100644 --- a/src/slskd/Application/Exceptions/RetryException.cs +++ b/src/slskd/Exceptions/RetryException.cs diff --git a/src/slskd/Application/Exceptions/ShareAliasException.cs b/src/slskd/Exceptions/ShareAliasException.cs index 3047d0a9..3047d0a9 100644 --- a/src/slskd/Application/Exceptions/ShareAliasException.cs +++ b/src/slskd/Exceptions/ShareAliasException.cs diff --git a/src/slskd/Application/Exceptions/ShareScanInProgressException.cs b/src/slskd/Exceptions/ShareScanInProgressException.cs index 2e548930..2e548930 100644 --- a/src/slskd/Application/Exceptions/ShareScanInProgressException.cs +++ b/src/slskd/Exceptions/ShareScanInProgressException.cs diff --git a/src/slskd/Application/Exceptions/SlskdException.cs b/src/slskd/Exceptions/SlskdException.cs index 6b4cfc2a..6b4cfc2a 100644 --- a/src/slskd/Application/Exceptions/SlskdException.cs +++ b/src/slskd/Exceptions/SlskdException.cs diff --git a/src/slskd/Startup.cs b/src/slskd/Startup.cs index b47faf2e..2f50cf59 100644 --- a/src/slskd/Startup.cs +++ b/src/slskd/Startup.cs @@ -34,11 +34,13 @@ namespace slskd using Prometheus.SystemMetrics; using Serilog; using slskd.Authentication; + using slskd.Core; using slskd.Cryptography; using slskd.Integrations.FTP; using slskd.Integrations.Pushbullet; using slskd.Messaging; using slskd.Search; + using slskd.Shares; using slskd.Transfers; using slskd.Users; using slskd.Validation; @@ -313,7 +315,8 @@ namespace slskd app.UseAuthorization(); app.UseEndpoints(endpoints => { - endpoints.MapHub<Hub>("/hub"); + endpoints.MapHub<ApplicationHub>("/hub/application"); + endpoints.MapControllers(); endpoints.MapHealthChecks("/health"); |
