From dcf97efaf8f24c8ee28c616c8f45263ccaa77b5c Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Sat, 15 Aug 2020 23:22:26 -0400 Subject: Rename PackageInstallationFailedLogger to have more consistent naming. --- .../Updates/PackageInstallationFailedLogger.cs | 51 ---------------------- .../Updates/PluginInstallationFailedLogger.cs | 51 ++++++++++++++++++++++ .../Events/EventingServiceCollectionExtensions.cs | 2 +- 3 files changed, 52 insertions(+), 52 deletions(-) delete mode 100644 Jellyfin.Server.Implementations/Events/Consumers/Updates/PackageInstallationFailedLogger.cs create mode 100644 Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationFailedLogger.cs (limited to 'Jellyfin.Server.Implementations') diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Updates/PackageInstallationFailedLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Updates/PackageInstallationFailedLogger.cs deleted file mode 100644 index 5d7296b3b..000000000 --- a/Jellyfin.Server.Implementations/Events/Consumers/Updates/PackageInstallationFailedLogger.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Globalization; -using System.Threading.Tasks; -using Jellyfin.Data.Entities; -using MediaBrowser.Common.Updates; -using MediaBrowser.Controller.Events; -using MediaBrowser.Model.Activity; -using MediaBrowser.Model.Globalization; -using MediaBrowser.Model.Notifications; - -namespace Jellyfin.Server.Implementations.Events.Consumers.Updates -{ - /// - /// Creates an entry in the activity log when a package installation fails. - /// - public class PackageInstallationFailedLogger : IEventConsumer - { - private readonly ILocalizationManager _localizationManager; - private readonly IActivityManager _activityManager; - - /// - /// Initializes a new instance of the class. - /// - /// The localization manager. - /// The activity manager. - public PackageInstallationFailedLogger(ILocalizationManager localizationManager, IActivityManager activityManager) - { - _localizationManager = localizationManager; - _activityManager = activityManager; - } - - /// - public async Task OnEvent(InstallationFailedEventArgs eventArgs) - { - await _activityManager.CreateAsync(new ActivityLog( - string.Format( - CultureInfo.InvariantCulture, - _localizationManager.GetLocalizedString("NameInstallFailed"), - eventArgs.InstallationInfo.Name), - NotificationType.InstallationFailed.ToString(), - Guid.Empty) - { - ShortOverview = string.Format( - CultureInfo.InvariantCulture, - _localizationManager.GetLocalizedString("VersionNumber"), - eventArgs.InstallationInfo.Version), - Overview = eventArgs.Exception.Message - }).ConfigureAwait(false); - } - } -} diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationFailedLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationFailedLogger.cs new file mode 100644 index 000000000..d71c298c5 --- /dev/null +++ b/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationFailedLogger.cs @@ -0,0 +1,51 @@ +using System; +using System.Globalization; +using System.Threading.Tasks; +using Jellyfin.Data.Entities; +using MediaBrowser.Common.Updates; +using MediaBrowser.Controller.Events; +using MediaBrowser.Model.Activity; +using MediaBrowser.Model.Globalization; +using MediaBrowser.Model.Notifications; + +namespace Jellyfin.Server.Implementations.Events.Consumers.Updates +{ + /// + /// Creates an entry in the activity log when a package installation fails. + /// + public class PluginInstallationFailedLogger : IEventConsumer + { + private readonly ILocalizationManager _localizationManager; + private readonly IActivityManager _activityManager; + + /// + /// Initializes a new instance of the class. + /// + /// The localization manager. + /// The activity manager. + public PluginInstallationFailedLogger(ILocalizationManager localizationManager, IActivityManager activityManager) + { + _localizationManager = localizationManager; + _activityManager = activityManager; + } + + /// + public async Task OnEvent(InstallationFailedEventArgs eventArgs) + { + await _activityManager.CreateAsync(new ActivityLog( + string.Format( + CultureInfo.InvariantCulture, + _localizationManager.GetLocalizedString("NameInstallFailed"), + eventArgs.InstallationInfo.Name), + NotificationType.InstallationFailed.ToString(), + Guid.Empty) + { + ShortOverview = string.Format( + CultureInfo.InvariantCulture, + _localizationManager.GetLocalizedString("VersionNumber"), + eventArgs.InstallationInfo.Version), + Overview = eventArgs.Exception.Message + }).ConfigureAwait(false); + } + } +} diff --git a/Jellyfin.Server.Implementations/Events/EventingServiceCollectionExtensions.cs b/Jellyfin.Server.Implementations/Events/EventingServiceCollectionExtensions.cs index 84181f4fe..de9dc08af 100644 --- a/Jellyfin.Server.Implementations/Events/EventingServiceCollectionExtensions.cs +++ b/Jellyfin.Server.Implementations/Events/EventingServiceCollectionExtensions.cs @@ -43,7 +43,7 @@ namespace Jellyfin.Server.Implementations.Events collection.AddScoped, PluginInstalledLogger>(); collection.AddScoped, PluginUninstalledLogger>(); collection.AddScoped, PluginUpdatedLogger>(); - collection.AddScoped, PackageInstallationFailedLogger>(); + collection.AddScoped, PluginInstallationFailedLogger>(); collection.AddScoped, UserCreatedLogger>(); collection.AddScoped, UserDeletedLogger>(); -- cgit v1.2.3