aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Monteiro <marknr.monteiro@protonmail.com>2020-04-04 13:03:32 -0400
committerMark Monteiro <marknr.monteiro@protonmail.com>2020-04-04 13:03:32 -0400
commitf1d0fb1edb56e488bb1ef8f7b4ca2cd9b878f312 (patch)
tree2595faf6d3f269a099fe64c2f8ab5adf16a8ec82
parent78370911c20d83b4f7fc9ca1fb89e5fdd978f0ef (diff)
Register INotificationManager correctly; resolve services correctly
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs11
1 files changed, 4 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 777c12eae..0fcfedd6b 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -732,7 +732,7 @@ namespace Emby.Server.Implementations
FileSystemManager,
ProcessFactory,
LocalizationManager,
- ServiceProvider.GetRequiredService<ISubtitleEncoder>,
+ Resolve<ISubtitleEncoder>,
startupConfig,
StartupOptions.FFmpegPath);
serviceCollection.AddSingleton(MediaEncoder);
@@ -807,11 +807,7 @@ namespace Emby.Server.Implementations
UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, UserManager, ChannelManager, LiveTvManager, ServerConfigurationManager);
serviceCollection.AddSingleton(UserViewManager);
- NotificationManager = new NotificationManager(
- LoggerFactory.CreateLogger<NotificationManager>(),
- UserManager,
- ServerConfigurationManager);
- serviceCollection.AddSingleton(NotificationManager);
+ serviceCollection.AddSingleton<INotificationManager, NotificationManager>();
serviceCollection.AddSingleton<IDeviceDiscovery, DeviceDiscovery>();
@@ -840,6 +836,7 @@ namespace Emby.Server.Implementations
/// </summary>
public void InitializeServices()
{
+ NotificationManager = Resolve<INotificationManager>();
HttpServer = Resolve<IHttpServer>();
((ActivityRepository)Resolve<IActivityRepository>()).Initialize();
@@ -972,7 +969,7 @@ namespace Emby.Server.Implementations
CollectionFolder.XmlSerializer = XmlSerializer;
CollectionFolder.JsonSerializer = JsonSerializer;
CollectionFolder.ApplicationHost = this;
- AuthenticatedAttribute.AuthService = ServiceProvider.GetRequiredService<IAuthService>();
+ AuthenticatedAttribute.AuthService = Resolve<IAuthService>();
}
private async void PluginInstalled(object sender, GenericEventArgs<PackageVersionInfo> args)