Migrate ServerEventNotifier.OnPackageInstallationFailed to IEventConsumer

This commit is contained in:
Patrick Barron
2020-08-15 23:12:34 -04:00
parent 4478945e20
commit 25437af594
2 changed files with 31 additions and 7 deletions

View File

@@ -38,7 +38,6 @@ namespace Emby.Server.Implementations.EntryPoints
{
_installationManager.PackageInstallationCancelled += OnPackageInstallationCancelled;
_installationManager.PackageInstallationCompleted += OnPackageInstallationCompleted;
_installationManager.PackageInstallationFailed += OnPackageInstallationFailed;
return Task.CompletedTask;
}
@@ -53,11 +52,6 @@ namespace Emby.Server.Implementations.EntryPoints
await SendMessageToAdminSessions("PackageInstallationCompleted", e).ConfigureAwait(false);
}
private async void OnPackageInstallationFailed(object sender, InstallationFailedEventArgs e)
{
await SendMessageToAdminSessions("PackageInstallationFailed", e.InstallationInfo).ConfigureAwait(false);
}
private async Task SendMessageToAdminSessions<T>(string name, T data)
{
try
@@ -86,7 +80,6 @@ namespace Emby.Server.Implementations.EntryPoints
{
_installationManager.PackageInstallationCancelled -= OnPackageInstallationCancelled;
_installationManager.PackageInstallationCompleted -= OnPackageInstallationCompleted;
_installationManager.PackageInstallationFailed -= OnPackageInstallationFailed;
}
}
}