From 7884c3813d682ca6ae8d7df4a6ba11f61e1d8ae0 Mon Sep 17 00:00:00 2001 From: Mark Monteiro Date: Sat, 4 Apr 2020 12:51:56 -0400 Subject: [PATCH] Register IEncodingManager correctly; remove unnecessary properties in ApplicationHost --- .../ApplicationHost.cs | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 3209ab3b78..7d72b8e08b 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -282,16 +282,12 @@ namespace Emby.Server.Implementations /// The media encoder. private IMediaEncoder MediaEncoder { get; set; } - private ISubtitleEncoder SubtitleEncoder { get; set; } - private ISessionManager SessionManager { get; set; } private ILiveTvManager LiveTvManager { get; set; } public LocalizationManager LocalizationManager { get; set; } - private IEncodingManager EncodingManager { get; set; } - private IChannelManager ChannelManager { get; set; } /// @@ -326,8 +322,6 @@ namespace Emby.Server.Implementations /// The installation manager. protected IInstallationManager InstallationManager { get; private set; } - protected IAuthService AuthService { get; private set; } - public IStartupOptions StartupOptions { get; } internal IImageEncoder ImageEncoder { get; private set; } @@ -740,7 +734,7 @@ namespace Emby.Server.Implementations FileSystemManager, ProcessFactory, LocalizationManager, - () => SubtitleEncoder, + ServiceProvider.GetRequiredService, startupConfig, StartupOptions.FFmpegPath); serviceCollection.AddSingleton(MediaEncoder); @@ -826,13 +820,7 @@ namespace Emby.Server.Implementations ChapterManager = new ChapterManager(ItemRepository); serviceCollection.AddSingleton(ChapterManager); - EncodingManager = new MediaEncoder.EncodingManager( - LoggerFactory.CreateLogger(), - FileSystemManager, - MediaEncoder, - ChapterManager, - LibraryManager); - serviceCollection.AddSingleton(EncodingManager); + serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); @@ -856,8 +844,6 @@ namespace Emby.Server.Implementations public void InitializeServices() { HttpServer = Resolve(); - AuthService = Resolve(); - SubtitleEncoder = Resolve(); ((ActivityRepository)Resolve()).Initialize(); _displayPreferencesRepository.Initialize(); @@ -989,7 +975,7 @@ namespace Emby.Server.Implementations CollectionFolder.XmlSerializer = XmlSerializer; CollectionFolder.JsonSerializer = JsonSerializer; CollectionFolder.ApplicationHost = this; - AuthenticatedAttribute.AuthService = AuthService; + AuthenticatedAttribute.AuthService = ServiceProvider.GetRequiredService(); } private async void PluginInstalled(object sender, GenericEventArgs args)