aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Monteiro <marknr.monteiro@protonmail.com>2020-04-04 15:05:50 -0400
committerMark Monteiro <marknr.monteiro@protonmail.com>2020-04-04 15:05:50 -0400
commit0ce82ab33288727fcbb400d72db62df440ef104d (patch)
tree43985eec70feb2a8c34fa1252cc7015ae50fc781
parent51b9a6e94b06db6ae4b21cf2372287a98778a075 (diff)
Remove unnecessary fields in ApplicationHost
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs21
-rw-r--r--Jellyfin.Server/Program.cs1
2 files changed, 9 insertions, 13 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 8a3398e01..81736f053 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -120,9 +120,7 @@ namespace Emby.Server.Implementations
{
private SqliteUserRepository _userRepository;
private SqliteDisplayPreferencesRepository _displayPreferencesRepository;
- private IChannelManager _channelManager;
private ISessionManager _sessionManager;
- private ILiveTvManager _liveTvManager;
private INotificationManager _notificationManager;
private IHttpServer _httpServer;
@@ -803,10 +801,7 @@ namespace Emby.Server.Implementations
/// </summary>
public void InitializeServices()
{
- _channelManager = Resolve<IChannelManager>();
_sessionManager = Resolve<ISessionManager>();
- _liveTvManager = Resolve<ILiveTvManager>();
- _notificationManager = Resolve<INotificationManager>();
_httpServer = Resolve<IHttpServer>();
((ActivityRepository)Resolve<IActivityRepository>()).Initialize();
@@ -821,6 +816,8 @@ namespace Emby.Server.Implementations
((UserDataManager)UserDataManager).Repository = userDataRepo;
ItemRepository.Initialize(userDataRepo, UserManager);
((LibraryManager)LibraryManager).ItemRepository = ItemRepository;
+
+ FindParts();
}
public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths)
@@ -930,8 +927,8 @@ namespace Emby.Server.Implementations
User.UserManager = UserManager;
BaseItem.FileSystem = FileSystemManager;
BaseItem.UserDataManager = UserDataManager;
- BaseItem.ChannelManager = _channelManager;
- Video.LiveTvManager = _liveTvManager;
+ BaseItem.ChannelManager = Resolve<IChannelManager>();
+ Video.LiveTvManager = Resolve<ILiveTvManager>();
Folder.UserViewManager = Resolve<IUserViewManager>();
UserView.TVSeriesManager = TVSeriesManager;
UserView.CollectionManager = Resolve<ICollectionManager>();
@@ -978,9 +975,9 @@ namespace Emby.Server.Implementations
}
/// <summary>
- /// Finds the parts.
+ /// Finds plugin components and register them with the appropriate services.
/// </summary>
- public void FindParts()
+ private void FindParts()
{
InstallationManager = ServiceProvider.GetService<IInstallationManager>();
InstallationManager.PluginInstalled += PluginInstalled;
@@ -1013,15 +1010,15 @@ namespace Emby.Server.Implementations
GetExports<IMetadataSaver>(),
GetExports<IExternalId>());
- _liveTvManager.AddParts(GetExports<ILiveTvService>(), GetExports<ITunerHost>(), GetExports<IListingsProvider>());
+ Resolve<ILiveTvManager>().AddParts(GetExports<ILiveTvService>(), GetExports<ITunerHost>(), GetExports<IListingsProvider>());
SubtitleManager.AddParts(GetExports<ISubtitleProvider>());
- _channelManager.AddParts(GetExports<IChannel>());
+ Resolve<IChannelManager>().AddParts(GetExports<IChannel>());
MediaSourceManager.AddParts(GetExports<IMediaSourceProvider>());
- _notificationManager.AddParts(GetExports<INotificationService>(), GetExports<INotificationTypeFactory>());
+ Resolve<INotificationManager>().AddParts(GetExports<INotificationService>(), GetExports<INotificationTypeFactory>());
UserManager.AddParts(GetExports<IAuthenticationProvider>(), GetExports<IPasswordResetProvider>());
IsoManager.AddParts(GetExports<IIsoMounter>());
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 4abdd59aa..6be9ba4f2 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -210,7 +210,6 @@ namespace Jellyfin.Server
// Re-use the web host service provider in the app host since ASP.NET doesn't allow a custom service collection.
appHost.ServiceProvider = webHost.Services;
appHost.InitializeServices();
- appHost.FindParts();
Migrations.MigrationRunner.Run(appHost, _loggerFactory);
try