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