Revert "Fixed SessionWebSocketListener.OnServerManagerWebSocketConnected."

This commit is contained in:
cvium 2020-11-28 09:50:30 +01:00
parent 1a0d8aef80
commit 3ae39d44da
3 changed files with 3 additions and 15 deletions

View File

@ -58,7 +58,7 @@ namespace Jellyfin.Api.WebSocketListeners
private void OnEntryCreated(object? sender, GenericEventArgs<ActivityLogEntry> e)
{
SendData(true).GetAwaiter().GetResult();
SendData(true);
}
}
}

View File

@ -82,11 +82,10 @@ namespace Jellyfin.Server
ServiceCollection.AddSingleton<IUserManager, UserManager>();
ServiceCollection.AddSingleton<IDisplayPreferencesManager, DisplayPreferencesManager>();
ServiceCollection.AddScoped<IWebSocketListener, SessionWebSocketListener>();
ServiceCollection.AddScoped<IWebSocketListener, ActivityLogWebSocketListener>();
ServiceCollection.AddScoped<IWebSocketListener, ScheduledTasksWebSocketListener>();
ServiceCollection.AddScoped<IWebSocketListener, SessionInfoWebSocketListener>();
// This one has to be last as DI will select it for parameterization.
ServiceCollection.AddScoped<IWebSocketListener, SessionWebSocketListener>();
// TODO fix circular dependency on IWebSocketManager
ServiceCollection.AddScoped(serviceProvider => new Lazy<IEnumerable<IWebSocketListener>>(serviceProvider.GetRequiredService<IEnumerable<IWebSocketListener>>));

View File

@ -25,19 +25,8 @@ namespace Jellyfin.Server.Middleware
/// </summary>
/// <param name="httpContext">The current HTTP context.</param>
/// <param name="webSocketManager">The WebSocket connection manager.</param>
/// <param name="websocketListener">Session manager instance.</param>
/// <returns>The async task.</returns>
public async Task Invoke(
HttpContext httpContext,
IWebSocketManager webSocketManager,
#pragma warning disable CA1801
#pragma warning disable IDE0060
// TODO: Workaround. see https://github.com/jellyfin/jellyfin/pull/3194
// Do not remove this parameter. It uses DI to create a SessionWebSocketListener which is
// required for webSocketManager events.
IWebSocketListener websocketListener)
#pragma warning restore IDE0060 // Remove unused parameter
#pragma warning restore CA1801
public async Task Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
{
if (!httpContext.WebSockets.IsWebSocketRequest)
{