fix(session): satisfy StyleCop member ordering and indentation
This commit is contained in:
@@ -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>();
|
||||
}
|
||||
|
||||
@@ -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>())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user