fix(session): satisfy StyleCop member ordering and indentation
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful

This commit is contained in:
2026-09-24 23:08:52 +10:00
parent 00d0765152
commit 6f362c33c9
2 changed files with 10 additions and 9 deletions
@@ -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<string, SessionInfo> _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<IReadOnlyList<SessionDirectoryEntry>> GetRemoteEntriesAsync(CancellationToken cancellationToken)
{
if (!DirectoryEnabled)
if (!_directoryEnabled)
{
return Array.Empty<SessionDirectoryEntry>();
}
+3 -3
View File
@@ -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<ILyricProvider>())
{