aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
authorAnthony Lavado <anthonylavado@users.noreply.github.com>2019-03-27 09:53:45 -0400
committerGitHub <noreply@github.com>2019-03-27 09:53:45 -0400
commit524357bfa845e1c01ef280b1d0fc3896b7b9dbaa (patch)
treef5a194260683b1469f6d7ed1e9af644af2756c99 /Emby.Server.Implementations/ApplicationHost.cs
parent31607fbb377c826415dc0f6689ac4189b38c840f (diff)
parent7343e07fe587b4817f5e80b68359d3193674e6ab (diff)
Merge pull request #1157 from Bond-009/smallfix
Simplify/remove/clean code
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs18
1 files changed, 7 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 484942946..e15cb68e9 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -200,7 +200,7 @@ namespace Emby.Server.Implementations
/// <summary>
/// The disposable parts
/// </summary>
- protected readonly List<IDisposable> _disposableParts = new List<IDisposable>();
+ private readonly List<IDisposable> _disposableParts = new List<IDisposable>();
/// <summary>
/// Gets the configuration manager.
@@ -216,8 +216,9 @@ namespace Emby.Server.Implementations
{
#if BETA
return PackageVersionClass.Beta;
-#endif
+#else
return PackageVersionClass.Release;
+#endif
}
}
@@ -340,7 +341,6 @@ namespace Emby.Server.Implementations
protected IProcessFactory ProcessFactory { get; private set; }
- protected ICryptoProvider CryptographyProvider = new CryptographyProvider();
protected readonly IXmlSerializer XmlSerializer;
protected ISocketFactory SocketFactory { get; private set; }
@@ -369,9 +369,6 @@ namespace Emby.Server.Implementations
{
_configuration = configuration;
- // hack alert, until common can target .net core
- BaseExtensions.CryptographyProvider = CryptographyProvider;
-
XmlSerializer = new MyXmlSerializer(fileSystem, loggerFactory);
NetworkManager = networkManager;
@@ -735,13 +732,12 @@ namespace Emby.Server.Implementations
ApplicationHost.StreamHelper = new StreamHelper();
serviceCollection.AddSingleton(StreamHelper);
- serviceCollection.AddSingleton(CryptographyProvider);
+ serviceCollection.AddSingleton(typeof(ICryptoProvider), typeof(CryptographyProvider));
SocketFactory = new SocketFactory();
serviceCollection.AddSingleton(SocketFactory);
- InstallationManager = new InstallationManager(LoggerFactory, this, ApplicationPaths, HttpClient, JsonSerializer, ServerConfigurationManager, FileSystemManager, CryptographyProvider, ZipClient, PackageRuntime);
- serviceCollection.AddSingleton(InstallationManager);
+ serviceCollection.AddSingleton(typeof(IInstallationManager), typeof(InstallationManager));
ZipClient = new ZipClient();
serviceCollection.AddSingleton(ZipClient);
@@ -908,8 +904,6 @@ namespace Emby.Server.Implementations
_serviceProvider = serviceCollection.BuildServiceProvider();
}
- public virtual string PackageRuntime => "netcore";
-
public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths)
{
// Distinct these to prevent users from reporting problems that aren't actually problems
@@ -1049,6 +1043,8 @@ namespace Emby.Server.Implementations
/// </summary>
protected void FindParts()
{
+ InstallationManager = _serviceProvider.GetService<IInstallationManager>();
+
if (!ServerConfigurationManager.Configuration.IsPortAuthorized)
{
ServerConfigurationManager.Configuration.IsPortAuthorized = true;