From 6f362c33c91a15bf9fcb33d3623638768c007c74 Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Thu, 24 Sep 2026 23:08:52 +1000 Subject: [PATCH] fix(session): satisfy StyleCop member ordering and indentation --- .../Session/SessionManager.cs | 13 +++++++------ Jellyfin.Server/CoreAppHost.cs | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index ae3f3c1fb9..c0adde9a5f 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -66,6 +66,7 @@ namespace Emby.Server.Implementations.Session private readonly ISessionDirectory _sessionDirectory; private readonly IPodMessageBus _podMessageBus; private readonly SessionDirectoryOptions _sessionDirectoryOptions; + private readonly bool _directoryEnabled; private readonly CancellationTokenRegistration _shutdownCallback; private readonly ConcurrentDictionary _activeConnections = new(StringComparer.OrdinalIgnoreCase); @@ -136,7 +137,9 @@ namespace Emby.Server.Implementations.Session _deviceManager.DeviceOptionsUpdated += OnDeviceManagerDeviceOptionsUpdated; - if (_sessionDirectory is not NullSessionDirectory) + _directoryEnabled = _sessionDirectory is not NullSessionDirectory; + + if (_directoryEnabled) { _podMessageBus.Subscribe(OnPodMessage); var interval = TimeSpan.FromSeconds(Math.Max(1, _sessionDirectoryOptions.RefreshIntervalSeconds)); @@ -335,11 +338,9 @@ namespace Emby.Server.Implementations.Session _ = PublishToDirectoryAsync(session); } - private bool DirectoryEnabled => _sessionDirectory is not NullSessionDirectory; - private async Task PublishToDirectoryAsync(SessionInfo session) { - if (!DirectoryEnabled || string.IsNullOrEmpty(session.Id)) + if (!_directoryEnabled || string.IsNullOrEmpty(session.Id)) { return; } @@ -361,7 +362,7 @@ namespace Emby.Server.Implementations.Session private async ValueTask RemoveFromDirectoryAsync(SessionInfo session) { - if (!DirectoryEnabled || string.IsNullOrEmpty(session.Id)) + if (!_directoryEnabled || string.IsNullOrEmpty(session.Id)) { return; } @@ -386,7 +387,7 @@ namespace Emby.Server.Implementations.Session private async Task> GetRemoteEntriesAsync(CancellationToken cancellationToken) { - if (!DirectoryEnabled) + if (!_directoryEnabled) { return Array.Empty(); } diff --git a/Jellyfin.Server/CoreAppHost.cs b/Jellyfin.Server/CoreAppHost.cs index ece3cd971d..29ed62c137 100644 --- a/Jellyfin.Server/CoreAppHost.cs +++ b/Jellyfin.Server/CoreAppHost.cs @@ -116,9 +116,9 @@ namespace Jellyfin.Server // to the other instances. Redis-backed when configured, no-op otherwise. serviceCollection.AddConfigurationInvalidationBus(_startupConfig, Logger); - // Session directory: publishes which instance holds which session and routes remote-control - // messages to it. Redis-backed when configured, no-op otherwise. - serviceCollection.AddSessionDirectory(_startupConfig, Logger); + // Session directory: publishes which instance holds which session and routes remote-control + // messages to it. Redis-backed when configured, no-op otherwise. + serviceCollection.AddSessionDirectory(_startupConfig, Logger); foreach (var type in GetExportTypes()) {