aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/EntryPoints/ServerEventNotifier.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/EntryPoints/ServerEventNotifier.cs')
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/ServerEventNotifier.cs13
1 files changed, 12 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/ServerEventNotifier.cs b/MediaBrowser.Server.Implementations/EntryPoints/ServerEventNotifier.cs
index 305f2800f..b969d551a 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/ServerEventNotifier.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/ServerEventNotifier.cs
@@ -3,11 +3,13 @@ using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Common.Updates;
using MediaBrowser.Controller;
+using MediaBrowser.Controller.Activity;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
+using MediaBrowser.Model.Activity;
using MediaBrowser.Model.Events;
using System;
using System.Threading;
@@ -47,6 +49,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
private readonly IDtoService _dtoService;
private readonly ISessionManager _sessionManager;
+ private readonly IActivityManager _activityManager;
/// <summary>
/// Initializes a new instance of the <see cref="ServerEventNotifier" /> class.
@@ -58,7 +61,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
/// <param name="taskManager">The task manager.</param>
/// <param name="dtoService">The dto service.</param>
/// <param name="sessionManager">The session manager.</param>
- public ServerEventNotifier(IServerManager serverManager, IServerApplicationHost appHost, IUserManager userManager, IInstallationManager installationManager, ITaskManager taskManager, IDtoService dtoService, ISessionManager sessionManager)
+ public ServerEventNotifier(IServerManager serverManager, IServerApplicationHost appHost, IUserManager userManager, IInstallationManager installationManager, ITaskManager taskManager, IDtoService dtoService, ISessionManager sessionManager, IActivityManager activityManager)
{
_serverManager = serverManager;
_userManager = userManager;
@@ -67,6 +70,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
_taskManager = taskManager;
_dtoService = dtoService;
_sessionManager = sessionManager;
+ _activityManager = activityManager;
}
public void Run()
@@ -84,6 +88,13 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
_installationManager.PackageInstallationFailed += _installationManager_PackageInstallationFailed;
_taskManager.TaskCompleted += _taskManager_TaskCompleted;
+
+ _activityManager.EntryCreated += _activityManager_EntryCreated;
+ }
+
+ void _activityManager_EntryCreated(object sender, GenericEventArgs<ActivityLogEntry> e)
+ {
+ _serverManager.SendWebSocketMessage("ActivityLogEntryCreated", e.Argument);
}
void _userManager_UserConfigurationUpdated(object sender, GenericEventArgs<User> e)