aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs22
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);