using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Events;
using MediaBrowser.Controller.Events.Updates;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Session;
namespace Jellyfin.Server.Implementations.Events.Consumers.Updates
{
///
/// Notifies admin users when a plugin is installed.
///
public class PluginInstalledNotifier : IEventConsumer
{
private readonly ISessionManager _sessionManager;
///
/// Initializes a new instance of the class.
///
/// The session manager.
public PluginInstalledNotifier(ISessionManager sessionManager)
{
_sessionManager = sessionManager;
}
///
public async Task OnEvent(PluginInstalledEventArgs eventArgs)
{
await _sessionManager.SendMessageToAdminSessions(SessionMessageType.PackageInstallationCompleted, eventArgs.Argument, CancellationToken.None).ConfigureAwait(false);
}
}
}