diff --git a/Selector.SignalR/INow.cs b/Selector.SignalR/INow.cs index 295dd80..6c44343 100644 --- a/Selector.SignalR/INow.cs +++ b/Selector.SignalR/INow.cs @@ -9,7 +9,7 @@ public interface INowPlayingHubClient public Task OnNewPlaying(CurrentlyPlayingDTO context); public Task OnNewAudioFeature(TrackAudioFeatures features); public Task OnNewPlayCount(PlayCount playCount); - public Task OnNewCard(ICard card); + public Task OnNewCard(Card card); } public interface INowPlayingHub diff --git a/Selector.SignalR/IPast.cs b/Selector.SignalR/IPast.cs index 8f365c6..bdad92a 100644 --- a/Selector.SignalR/IPast.cs +++ b/Selector.SignalR/IPast.cs @@ -5,7 +5,7 @@ namespace Selector.SignalR; public interface IPastHub { Task OnConnected(); - Task OnSubmitted(IPastParams param); + Task OnSubmitted(PastParams param); } public interface IPastHubClient diff --git a/Selector.Web/NowPlaying/Card.cs b/Selector.SignalR/Models/Card.cs similarity index 59% rename from Selector.Web/NowPlaying/Card.cs rename to Selector.SignalR/Models/Card.cs index 90f28e8..e253e52 100644 --- a/Selector.Web/NowPlaying/Card.cs +++ b/Selector.SignalR/Models/Card.cs @@ -1,9 +1,9 @@ using System; using Selector.SignalR; -namespace Selector.Web.NowPlaying; +namespace Selector.SignalR; -public class Card : ICard +public class Card { public string Content { get; set; } } diff --git a/Selector.SignalR/Models/ICard.cs b/Selector.SignalR/Models/ICard.cs deleted file mode 100644 index 1f98294..0000000 --- a/Selector.SignalR/Models/ICard.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Selector.SignalR; - -public interface ICard -{ - string Content { get; set; } -} \ No newline at end of file diff --git a/Selector.SignalR/Models/IPastParams.cs b/Selector.SignalR/Models/IPastParams.cs deleted file mode 100644 index f2e7750..0000000 --- a/Selector.SignalR/Models/IPastParams.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Selector.SignalR; - -public interface IPastParams -{ - string Track { get; set; } - string Album { get; set; } - string Artist { get; set; } - string From { get; set; } - string To { get; set; } -} \ No newline at end of file diff --git a/Selector.Web/Past/PastParams.cs b/Selector.SignalR/Models/PastParams.cs similarity index 79% rename from Selector.Web/Past/PastParams.cs rename to Selector.SignalR/Models/PastParams.cs index 40f811e..196b90d 100644 --- a/Selector.Web/Past/PastParams.cs +++ b/Selector.SignalR/Models/PastParams.cs @@ -1,9 +1,9 @@ using System; using Selector.SignalR; -namespace Selector.Web; +namespace Selector.SignalR; -public class PastParams : IPastParams +public class PastParams { public string Track { get; set; } public string Album { get; set; } diff --git a/Selector.SignalR/NowHubCache.cs b/Selector.SignalR/NowHubCache.cs index a1a8901..37d9533 100644 --- a/Selector.SignalR/NowHubCache.cs +++ b/Selector.SignalR/NowHubCache.cs @@ -10,7 +10,7 @@ public class NowHubCache private readonly ILogger logger; public TrackAudioFeatures LastFeature { get; private set; } - public List LastCards { get; private set; } = new(); + public List LastCards { get; private set; } = new(); private readonly object updateLock = new(); private readonly object bindingLock = new(); diff --git a/Selector.SignalR/NowHubClient.cs b/Selector.SignalR/NowHubClient.cs index e272244..31abdad 100644 --- a/Selector.SignalR/NowHubClient.cs +++ b/Selector.SignalR/NowHubClient.cs @@ -32,7 +32,7 @@ public class NowHubClient: BaseSignalRClient, INowPlayingHub, IDisposable NewPlayCountCallbacks.Add(hubConnection.On(nameof(OnNewPlayCount), action)); } - public void OnNewCard(Action action) + public void OnNewCard(Action action) { NewCardCallbacks.Add(hubConnection.On(nameof(OnNewCard), action)); } @@ -52,7 +52,7 @@ public class NowHubClient: BaseSignalRClient, INowPlayingHub, IDisposable NewPlayCountCallbacks.Add(hubConnection.On(nameof(OnNewPlayCount), action)); } - public void OnNewCard(Func action) + public void OnNewCard(Func action) { NewCardCallbacks.Add(hubConnection.On(nameof(OnNewCard), action)); } diff --git a/Selector.SignalR/PastHubClient.cs b/Selector.SignalR/PastHubClient.cs index d3b75f8..7ab414c 100644 --- a/Selector.SignalR/PastHubClient.cs +++ b/Selector.SignalR/PastHubClient.cs @@ -21,7 +21,7 @@ public class PastHubClient: BaseSignalRClient, IPastHub, IDisposable return hubConnection.InvokeAsync(nameof(OnConnected)); } - public Task OnSubmitted(IPastParams param) + public Task OnSubmitted(PastParams param) { return hubConnection.InvokeAsync(nameof(OnSubmitted), param); } diff --git a/Selector.Web/Hubs/NowPlayingHub.cs b/Selector.Web/Hubs/NowPlayingHub.cs index 97f2a35..1484372 100644 --- a/Selector.Web/Hubs/NowPlayingHub.cs +++ b/Selector.Web/Hubs/NowPlayingHub.cs @@ -12,7 +12,6 @@ using Selector.Cache; using Selector.Model; using Selector.Model.Extensions; using Selector.SignalR; -using Selector.Web.NowPlaying; using SpotifyAPI.Web; using StackExchange.Redis; diff --git a/Selector.Web/Hubs/PastHub.cs b/Selector.Web/Hubs/PastHub.cs index 4efe2c1..1be04f8 100644 --- a/Selector.Web/Hubs/PastHub.cs +++ b/Selector.Web/Hubs/PastHub.cs @@ -57,7 +57,7 @@ namespace Selector.Web.Hubs " (Expanded Edition)", }; - public async Task OnSubmitted(IPastParams param) + public async Task OnSubmitted(PastParams param) { param.Track = string.IsNullOrWhiteSpace(param.Track) ? null : param.Track; param.Album = string.IsNullOrWhiteSpace(param.Album) ? null : param.Album; diff --git a/Selector.Web/Selector.Web.csproj b/Selector.Web/Selector.Web.csproj index 715be8f..182c461 100644 --- a/Selector.Web/Selector.Web.csproj +++ b/Selector.Web/Selector.Web.csproj @@ -41,13 +41,11 @@ - -