diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-10-24 01:20:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-24 01:20:09 -0400 |
| commit | 0aac8045fb69ad1024859812a09e68070ea698f6 (patch) | |
| tree | 6e8b55133b0eeee606df5049497b80a612843733 /Emby.Server.Implementations/ApplicationHost.cs | |
| parent | 7924bb7c9add449f61d8695add6f2f3fcbc18a0a (diff) | |
| parent | 6c5f3ce07e8b36299a4143dc609999d880e7bdfd (diff) | |
Merge pull request #2974 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 57c509923..c1ab9ec22 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -775,7 +775,14 @@ namespace Emby.Server.Implementations } // Put the app config in the log for troubleshooting purposes - Logger.LogMultiline("Application configuration:", LogSeverity.Info, new StringBuilder(JsonSerializer.SerializeToString(ConfigurationManager.CommonConfiguration))); + var configJson = new StringBuilder(JsonSerializer.SerializeToString(ConfigurationManager.CommonConfiguration)); + + if (!string.IsNullOrWhiteSpace(ServerConfigurationManager.Configuration.CertificatePassword)) + { + configJson = configJson.Replace(ServerConfigurationManager.Configuration.CertificatePassword, "####"); + } + + Logger.LogMultiline("Application configuration:", LogSeverity.Info, configJson); if (Plugins != null) { @@ -792,6 +799,11 @@ namespace Emby.Server.Implementations protected abstract IConnectManager CreateConnectManager(); protected abstract ISyncManager CreateSyncManager(); + + protected virtual IHttpClient CreateHttpClient() + { + return new HttpClientManager.HttpClientManager(ApplicationPaths, LogManager.GetLogger("HttpClient"), FileSystemManager, MemoryStreamFactory, GetDefaultUserAgent); + } /// <summary> /// Registers resources that classes will depend on @@ -814,7 +826,7 @@ namespace Emby.Server.Implementations RegisterSingleInstance(FileSystemManager); - HttpClient = new HttpClientManager.HttpClientManager(ApplicationPaths, LogManager.GetLogger("HttpClient"), FileSystemManager, MemoryStreamFactory, GetDefaultUserAgent); + HttpClient = CreateHttpClient(); RegisterSingleInstance(HttpClient); RegisterSingleInstance(NetworkManager); @@ -938,7 +950,9 @@ namespace Emby.Server.Implementations ConnectManager = CreateConnectManager(); RegisterSingleInstance(ConnectManager); - DeviceManager = new DeviceManager(new DeviceRepository(ApplicationPaths, JsonSerializer, LogManager.GetLogger("DeviceManager"), FileSystemManager), UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager, LogManager.GetLogger("DeviceManager"), NetworkManager); + var deviceRepo = new SqliteDeviceRepository(LogManager.GetLogger("DeviceManager"), ServerConfigurationManager, FileSystemManager, JsonSerializer); + deviceRepo.Initialize(); + DeviceManager = new DeviceManager(deviceRepo, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager, LogManager.GetLogger("DeviceManager"), NetworkManager); RegisterSingleInstance(DeviceManager); var newsService = new Emby.Server.Implementations.News.NewsService(ApplicationPaths, JsonSerializer); @@ -1116,7 +1130,7 @@ namespace Emby.Server.Implementations IsoManager.AddParts(list); } - private string GetDefaultUserAgent() + protected string GetDefaultUserAgent() { var name = FormatAttribute(Name); |
