aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Session/SessionManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Session/SessionManager.cs')
-rw-r--r--Emby.Server.Implementations/Session/SessionManager.cs20
1 files changed, 8 insertions, 12 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index 9911cd0c6..7321e9f86 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/Emby.Server.Implementations/Session/SessionManager.cs
@@ -18,7 +18,6 @@ using MediaBrowser.Model.Library;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Session;
-using MediaBrowser.Model.Users;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -255,11 +254,10 @@ namespace Emby.Server.Implementations.Session
if ((activityDate - lastActivityDate).TotalSeconds > 10)
{
- EventHelper.FireEventIfNotNull(SessionActivity, this, new SessionEventArgs
+ SessionActivity?.Invoke(this, new SessionEventArgs
{
SessionInfo = session
-
- }, _logger);
+ });
}
return session;
@@ -693,7 +691,7 @@ namespace Emby.Server.Implementations.Session
}
}
- EventHelper.FireEventIfNotNull(PlaybackProgress, this, new PlaybackProgressEventArgs
+ PlaybackProgress?.Invoke(this, new PlaybackProgressEventArgs
{
Item = libraryItem,
Users = users,
@@ -707,8 +705,7 @@ namespace Emby.Server.Implementations.Session
PlaySessionId = info.PlaySessionId,
IsAutomated = isAutomated,
Session = session
-
- }, _logger);
+ });
if (!isAutomated)
{
@@ -1399,7 +1396,7 @@ namespace Emby.Server.Implementations.Session
if (result == null)
{
- EventHelper.FireEventIfNotNull(AuthenticationFailed, this, new GenericEventArgs<AuthenticationRequest>(request), _logger);
+ AuthenticationFailed?.Invoke(this, new GenericEventArgs<AuthenticationRequest>(request));
throw new SecurityException("Invalid user or password entered.");
}
@@ -1424,7 +1421,7 @@ namespace Emby.Server.Implementations.Session
ServerId = _appHost.SystemId
};
- EventHelper.FireEventIfNotNull(AuthenticationSucceeded, this, new GenericEventArgs<AuthenticationResult>(returnResult), _logger);
+ AuthenticationSucceeded?.Invoke(this, new GenericEventArgs<AuthenticationResult>(returnResult));
return returnResult;
}
@@ -1579,11 +1576,10 @@ namespace Emby.Server.Implementations.Session
if (saveCapabilities)
{
- EventHelper.FireEventIfNotNull(CapabilitiesChanged, this, new SessionEventArgs
+ CapabilitiesChanged?.Invoke(this, new SessionEventArgs
{
SessionInfo = session
-
- }, _logger);
+ });
try
{