Register IProcessFactory, ICryptoProvider and ISocketFactory correctly

This commit is contained in:
Mark Monteiro 2020-04-04 20:42:11 -04:00
parent aee6a1b476
commit 3f2f95d877

View File

@ -253,12 +253,8 @@ namespace Emby.Server.Implementations
public IStartupOptions StartupOptions { get; } public IStartupOptions StartupOptions { get; }
protected IProcessFactory ProcessFactory { get; private set; }
protected readonly IXmlSerializer XmlSerializer; protected readonly IXmlSerializer XmlSerializer;
protected ISocketFactory SocketFactory { get; private set; }
protected ITaskManager TaskManager { get; private set; } protected ITaskManager TaskManager { get; private set; }
public IHttpClient HttpClient { get; private set; } public IHttpClient HttpClient { get; private set; }
@ -605,16 +601,13 @@ namespace Emby.Server.Implementations
serviceCollection.AddSingleton(XmlSerializer); serviceCollection.AddSingleton(XmlSerializer);
ProcessFactory = new ProcessFactory(); serviceCollection.AddSingleton<IProcessFactory, ProcessFactory>();
serviceCollection.AddSingleton(ProcessFactory);
serviceCollection.AddSingleton<IStreamHelper, StreamHelper>(); serviceCollection.AddSingleton<IStreamHelper, StreamHelper>();
var cryptoProvider = new CryptographyProvider(); serviceCollection.AddSingleton<ICryptoProvider, CryptographyProvider>();
serviceCollection.AddSingleton<ICryptoProvider>(cryptoProvider);
SocketFactory = new SocketFactory(); serviceCollection.AddSingleton<ISocketFactory, SocketFactory>();
serviceCollection.AddSingleton(SocketFactory);
serviceCollection.AddSingleton<IInstallationManager, InstallationManager>(); serviceCollection.AddSingleton<IInstallationManager, InstallationManager>();
@ -1539,7 +1532,7 @@ namespace Emby.Server.Implementations
throw new NotSupportedException(); throw new NotSupportedException();
} }
var process = ProcessFactory.Create(new ProcessOptions var process = Resolve<IProcessFactory>().Create(new ProcessOptions
{ {
FileName = url, FileName = url,
EnableRaisingEvents = true, EnableRaisingEvents = true,