aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2020-08-15 02:02:58 -0400
committerPatrick Barron <barronpm@gmail.com>2020-08-15 02:02:58 -0400
commitca3a8bdb98aeb5d112a4d2a456ebcc445dc5fd12 (patch)
treee64586112b253266f9baffc6c8539cb3581c16ae /Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
parent98cbf1c2de5151e88977143e415fe4a0b3cad7cf (diff)
Migrate ActivityLogEntryPoint.OnSessionStarted to IEventConsumer
Diffstat (limited to 'Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs')
-rw-r--r--Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs27
1 files changed, 0 insertions, 27 deletions
diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
index 00a14fb0b..d863acd0b 100644
--- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
+++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
@@ -36,7 +36,6 @@ namespace Emby.Server.Implementations.Activity
/// <inheritdoc />
public Task RunAsync()
{
- _sessionManager.SessionStarted += OnSessionStarted;
_sessionManager.SessionEnded += OnSessionEnded;
return Task.CompletedTask;
@@ -67,38 +66,12 @@ namespace Emby.Server.Implementations.Activity
}).ConfigureAwait(false);
}
- private async void OnSessionStarted(object sender, SessionEventArgs e)
- {
- var session = e.SessionInfo;
-
- if (string.IsNullOrEmpty(session.UserName))
- {
- return;
- }
-
- await CreateLogEntry(new ActivityLog(
- string.Format(
- CultureInfo.InvariantCulture,
- _localization.GetLocalizedString("UserOnlineFromDevice"),
- session.UserName,
- session.DeviceName),
- "SessionStarted",
- session.UserId)
- {
- ShortOverview = string.Format(
- CultureInfo.InvariantCulture,
- _localization.GetLocalizedString("LabelIpAddressValue"),
- session.RemoteEndPoint)
- }).ConfigureAwait(false);
- }
-
private async Task CreateLogEntry(ActivityLog entry)
=> await _activityManager.CreateAsync(entry).ConfigureAwait(false);
/// <inheritdoc />
public void Dispose()
{
- _sessionManager.SessionStarted -= OnSessionStarted;
_sessionManager.SessionEnded -= OnSessionEnded;
}
}