|
|
@ -86,7 +86,6 @@ using MediaBrowser.Model.Activity;
|
|
|
|
using MediaBrowser.Model.Configuration;
|
|
|
|
using MediaBrowser.Model.Configuration;
|
|
|
|
using MediaBrowser.Model.Cryptography;
|
|
|
|
using MediaBrowser.Model.Cryptography;
|
|
|
|
using MediaBrowser.Model.Dlna;
|
|
|
|
using MediaBrowser.Model.Dlna;
|
|
|
|
using MediaBrowser.Model.Events;
|
|
|
|
|
|
|
|
using MediaBrowser.Model.Globalization;
|
|
|
|
using MediaBrowser.Model.Globalization;
|
|
|
|
using MediaBrowser.Model.IO;
|
|
|
|
using MediaBrowser.Model.IO;
|
|
|
|
using MediaBrowser.Model.MediaInfo;
|
|
|
|
using MediaBrowser.Model.MediaInfo;
|
|
|
@ -104,7 +103,6 @@ using MediaBrowser.WebDashboard.Api;
|
|
|
|
using MediaBrowser.XbmcMetadata.Providers;
|
|
|
|
using MediaBrowser.XbmcMetadata.Providers;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
using Microsoft.AspNetCore.Http.Extensions;
|
|
|
|
using Microsoft.AspNetCore.Http.Extensions;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
|
|
|
|
using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
|
|
|
@ -121,14 +119,20 @@ namespace Emby.Server.Implementations
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
private static readonly string[] _relevantEnvVarPrefixes = { "JELLYFIN_", "DOTNET_", "ASPNETCORE_" };
|
|
|
|
private static readonly string[] _relevantEnvVarPrefixes = { "JELLYFIN_", "DOTNET_", "ASPNETCORE_" };
|
|
|
|
|
|
|
|
|
|
|
|
private SqliteUserRepository _userRepository;
|
|
|
|
private readonly IFileSystem _fileSystemManager;
|
|
|
|
private SqliteDisplayPreferencesRepository _displayPreferencesRepository;
|
|
|
|
private readonly INetworkManager _networkManager;
|
|
|
|
|
|
|
|
private readonly IXmlSerializer _xmlSerializer;
|
|
|
|
|
|
|
|
private readonly IStartupOptions _startupOptions;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IMediaEncoder _mediaEncoder;
|
|
|
|
|
|
|
|
private ISessionManager _sessionManager;
|
|
|
|
|
|
|
|
private IHttpServer _httpServer;
|
|
|
|
|
|
|
|
private IHttpClient _httpClient;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Gets a value indicating whether this instance can self restart.
|
|
|
|
/// Gets a value indicating whether this instance can self restart.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
|
|
|
|
public bool CanSelfRestart => _startupOptions.RestartPath != null;
|
|
|
|
public abstract bool CanSelfRestart { get; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual bool CanLaunchWebBrowser
|
|
|
|
public virtual bool CanLaunchWebBrowser
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -139,7 +143,7 @@ namespace Emby.Server.Implementations
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (StartupOptions.IsService)
|
|
|
|
if (_startupOptions.IsService)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -209,8 +213,6 @@ namespace Emby.Server.Implementations
|
|
|
|
/// <value>The configuration manager.</value>
|
|
|
|
/// <value>The configuration manager.</value>
|
|
|
|
protected IConfigurationManager ConfigurationManager { get; set; }
|
|
|
|
protected IConfigurationManager ConfigurationManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public IFileSystem FileSystemManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the service provider.
|
|
|
|
/// Gets or sets the service provider.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -232,110 +234,6 @@ namespace Emby.Server.Implementations
|
|
|
|
/// <value>The server configuration manager.</value>
|
|
|
|
/// <value>The server configuration manager.</value>
|
|
|
|
public IServerConfigurationManager ServerConfigurationManager => (IServerConfigurationManager)ConfigurationManager;
|
|
|
|
public IServerConfigurationManager ServerConfigurationManager => (IServerConfigurationManager)ConfigurationManager;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets or sets the user manager.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <value>The user manager.</value>
|
|
|
|
|
|
|
|
public IUserManager UserManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets or sets the library manager.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <value>The library manager.</value>
|
|
|
|
|
|
|
|
internal ILibraryManager LibraryManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets or sets the directory watchers.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <value>The directory watchers.</value>
|
|
|
|
|
|
|
|
private ILibraryMonitor LibraryMonitor { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets or sets the provider manager.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <value>The provider manager.</value>
|
|
|
|
|
|
|
|
private IProviderManager ProviderManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets or sets the HTTP server.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <value>The HTTP server.</value>
|
|
|
|
|
|
|
|
private IHttpServer HttpServer { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IDtoService DtoService { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IImageProcessor ImageProcessor { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets or sets the media encoder.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <value>The media encoder.</value>
|
|
|
|
|
|
|
|
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; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets or sets the user data repository.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <value>The user data repository.</value>
|
|
|
|
|
|
|
|
private IUserDataManager UserDataManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
internal SqliteItemRepository ItemRepository { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private INotificationManager NotificationManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ISubtitleManager SubtitleManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IChapterManager ChapterManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IDeviceManager DeviceManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
internal IUserViewManager UserViewManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IAuthenticationRepository AuthenticationRepository { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ITVSeriesManager TVSeriesManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ICollectionManager CollectionManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IMediaSourceManager MediaSourceManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets the installation manager.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <value>The installation manager.</value>
|
|
|
|
|
|
|
|
protected IInstallationManager InstallationManager { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected IAuthService AuthService { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IStartupOptions StartupOptions { get; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
internal IImageEncoder ImageEncoder { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected readonly IXmlSerializer XmlSerializer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected ISocketFactory SocketFactory { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected ITaskManager TaskManager { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IHttpClient HttpClient { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected INetworkManager NetworkManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IJsonSerializer JsonSerializer { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected IIsoManager IsoManager { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="ApplicationHost" /> class.
|
|
|
|
/// Initializes a new instance of the <see cref="ApplicationHost" /> class.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -344,29 +242,33 @@ namespace Emby.Server.Implementations
|
|
|
|
ILoggerFactory loggerFactory,
|
|
|
|
ILoggerFactory loggerFactory,
|
|
|
|
IStartupOptions options,
|
|
|
|
IStartupOptions options,
|
|
|
|
IFileSystem fileSystem,
|
|
|
|
IFileSystem fileSystem,
|
|
|
|
IImageEncoder imageEncoder,
|
|
|
|
|
|
|
|
INetworkManager networkManager)
|
|
|
|
INetworkManager networkManager)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XmlSerializer = new MyXmlSerializer();
|
|
|
|
_xmlSerializer = new MyXmlSerializer();
|
|
|
|
|
|
|
|
|
|
|
|
NetworkManager = networkManager;
|
|
|
|
_networkManager = networkManager;
|
|
|
|
networkManager.LocalSubnetsFn = GetConfiguredLocalSubnets;
|
|
|
|
networkManager.LocalSubnetsFn = GetConfiguredLocalSubnets;
|
|
|
|
|
|
|
|
|
|
|
|
ApplicationPaths = applicationPaths;
|
|
|
|
ApplicationPaths = applicationPaths;
|
|
|
|
LoggerFactory = loggerFactory;
|
|
|
|
LoggerFactory = loggerFactory;
|
|
|
|
FileSystemManager = fileSystem;
|
|
|
|
_fileSystemManager = fileSystem;
|
|
|
|
|
|
|
|
|
|
|
|
ConfigurationManager = new ServerConfigurationManager(ApplicationPaths, LoggerFactory, XmlSerializer, FileSystemManager);
|
|
|
|
ConfigurationManager = new ServerConfigurationManager(ApplicationPaths, LoggerFactory, _xmlSerializer, _fileSystemManager);
|
|
|
|
|
|
|
|
|
|
|
|
Logger = LoggerFactory.CreateLogger("App");
|
|
|
|
Logger = LoggerFactory.CreateLogger<ApplicationHost>();
|
|
|
|
|
|
|
|
|
|
|
|
StartupOptions = options;
|
|
|
|
_startupOptions = options;
|
|
|
|
|
|
|
|
|
|
|
|
ImageEncoder = imageEncoder;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem));
|
|
|
|
fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem));
|
|
|
|
|
|
|
|
|
|
|
|
NetworkManager.NetworkChanged += OnNetworkChanged;
|
|
|
|
_networkManager.NetworkChanged += OnNetworkChanged;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CertificateInfo = new CertificateInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Path = ServerConfigurationManager.Configuration.CertificatePath,
|
|
|
|
|
|
|
|
Password = ServerConfigurationManager.Configuration.CertificatePassword
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
Certificate = GetCertificate(CertificateInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string ExpandVirtualPath(string path)
|
|
|
|
public string ExpandVirtualPath(string path)
|
|
|
@ -434,10 +336,7 @@ namespace Emby.Server.Implementations
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
/// Gets the name.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <value>The name.</value>
|
|
|
|
|
|
|
|
public string Name => ApplicationProductName;
|
|
|
|
public string Name => ApplicationProductName;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -527,7 +426,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
|
|
|
|
|
|
ConfigurationManager.ConfigurationUpdated += OnConfigurationUpdated;
|
|
|
|
ConfigurationManager.ConfigurationUpdated += OnConfigurationUpdated;
|
|
|
|
|
|
|
|
|
|
|
|
MediaEncoder.SetFFmpegPath();
|
|
|
|
_mediaEncoder.SetFFmpegPath();
|
|
|
|
|
|
|
|
|
|
|
|
Logger.LogInformation("ServerId: {0}", SystemId);
|
|
|
|
Logger.LogInformation("ServerId: {0}", SystemId);
|
|
|
|
|
|
|
|
|
|
|
@ -539,7 +438,7 @@ namespace Emby.Server.Implementations
|
|
|
|
Logger.LogInformation("Executed all pre-startup entry points in {Elapsed:g}", stopWatch.Elapsed);
|
|
|
|
Logger.LogInformation("Executed all pre-startup entry points in {Elapsed:g}", stopWatch.Elapsed);
|
|
|
|
|
|
|
|
|
|
|
|
Logger.LogInformation("Core startup complete");
|
|
|
|
Logger.LogInformation("Core startup complete");
|
|
|
|
HttpServer.GlobalResponse = null;
|
|
|
|
_httpServer.GlobalResponse = null;
|
|
|
|
|
|
|
|
|
|
|
|
stopWatch.Restart();
|
|
|
|
stopWatch.Restart();
|
|
|
|
await Task.WhenAll(StartEntryPoints(entryPoints, false)).ConfigureAwait(false);
|
|
|
|
await Task.WhenAll(StartEntryPoints(entryPoints, false)).ConfigureAwait(false);
|
|
|
@ -563,7 +462,7 @@ namespace Emby.Server.Implementations
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public async Task InitAsync(IServiceCollection serviceCollection, IConfiguration startupConfig)
|
|
|
|
public void Init(IServiceCollection serviceCollection)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
HttpPort = ServerConfigurationManager.Configuration.HttpServerPortNumber;
|
|
|
|
HttpPort = ServerConfigurationManager.Configuration.HttpServerPortNumber;
|
|
|
|
HttpsPort = ServerConfigurationManager.Configuration.HttpsPortNumber;
|
|
|
|
HttpsPort = ServerConfigurationManager.Configuration.HttpsPortNumber;
|
|
|
@ -575,8 +474,6 @@ namespace Emby.Server.Implementations
|
|
|
|
HttpsPort = ServerConfiguration.DefaultHttpsPort;
|
|
|
|
HttpsPort = ServerConfiguration.DefaultHttpsPort;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
JsonSerializer = new JsonSerializer();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Plugins != null)
|
|
|
|
if (Plugins != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var pluginBuilder = new StringBuilder();
|
|
|
|
var pluginBuilder = new StringBuilder();
|
|
|
@ -596,7 +493,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
|
|
|
|
|
|
DiscoverTypes();
|
|
|
|
DiscoverTypes();
|
|
|
|
|
|
|
|
|
|
|
|
await RegisterServices(serviceCollection, startupConfig).ConfigureAwait(false);
|
|
|
|
RegisterServices(serviceCollection);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async Task ExecuteWebsocketHandlerAsync(HttpContext context, Func<Task> next)
|
|
|
|
public async Task ExecuteWebsocketHandlerAsync(HttpContext context, Func<Task> next)
|
|
|
@ -607,7 +504,7 @@ namespace Emby.Server.Implementations
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
await HttpServer.ProcessWebSocketRequest(context).ConfigureAwait(false);
|
|
|
|
await _httpServer.ProcessWebSocketRequest(context).ConfigureAwait(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async Task ExecuteHttpHandlerAsync(HttpContext context, Func<Task> next)
|
|
|
|
public async Task ExecuteHttpHandlerAsync(HttpContext context, Func<Task> next)
|
|
|
@ -623,14 +520,16 @@ namespace Emby.Server.Implementations
|
|
|
|
var localPath = context.Request.Path.ToString();
|
|
|
|
var localPath = context.Request.Path.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
var req = new WebSocketSharpRequest(request, response, request.Path, LoggerFactory.CreateLogger<WebSocketSharpRequest>());
|
|
|
|
var req = new WebSocketSharpRequest(request, response, request.Path, LoggerFactory.CreateLogger<WebSocketSharpRequest>());
|
|
|
|
await HttpServer.RequestHandler(req, request.GetDisplayUrl(), request.Host.ToString(), localPath, context.RequestAborted).ConfigureAwait(false);
|
|
|
|
await _httpServer.RequestHandler(req, request.GetDisplayUrl(), request.Host.ToString(), localPath, context.RequestAborted).ConfigureAwait(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Registers services/resources with the service collection that will be available via DI.
|
|
|
|
/// Registers services/resources with the service collection that will be available via DI.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
protected async Task RegisterServices(IServiceCollection serviceCollection, IConfiguration startupConfig)
|
|
|
|
protected virtual void RegisterServices(IServiceCollection serviceCollection)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(_startupOptions);
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddMemoryCache();
|
|
|
|
serviceCollection.AddMemoryCache();
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(ConfigurationManager);
|
|
|
|
serviceCollection.AddSingleton(ConfigurationManager);
|
|
|
@ -638,240 +537,169 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IApplicationPaths>(ApplicationPaths);
|
|
|
|
serviceCollection.AddSingleton<IApplicationPaths>(ApplicationPaths);
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(JsonSerializer);
|
|
|
|
serviceCollection.AddSingleton<IJsonSerializer, JsonSerializer>();
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Support for injecting ILogger should be deprecated in favour of ILogger<T> and this removed
|
|
|
|
// TODO: Remove support for injecting ILogger completely
|
|
|
|
serviceCollection.AddSingleton<ILogger>(Logger);
|
|
|
|
serviceCollection.AddSingleton((provider) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Logger.LogWarning("Injecting ILogger directly is deprecated and should be replaced with ILogger<T>");
|
|
|
|
|
|
|
|
return Logger;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(FileSystemManager);
|
|
|
|
serviceCollection.AddSingleton(_fileSystemManager);
|
|
|
|
serviceCollection.AddSingleton<TvdbClientManager>();
|
|
|
|
serviceCollection.AddSingleton<TvdbClientManager>();
|
|
|
|
|
|
|
|
|
|
|
|
HttpClient = new HttpClientManager.HttpClientManager(
|
|
|
|
serviceCollection.AddSingleton<IHttpClient, HttpClientManager.HttpClientManager>();
|
|
|
|
ApplicationPaths,
|
|
|
|
|
|
|
|
LoggerFactory.CreateLogger<HttpClientManager.HttpClientManager>(),
|
|
|
|
|
|
|
|
FileSystemManager,
|
|
|
|
|
|
|
|
() => ApplicationUserAgent);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(HttpClient);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(NetworkManager);
|
|
|
|
serviceCollection.AddSingleton(_networkManager);
|
|
|
|
|
|
|
|
|
|
|
|
IsoManager = new IsoManager();
|
|
|
|
serviceCollection.AddSingleton<IIsoManager, IsoManager>();
|
|
|
|
serviceCollection.AddSingleton(IsoManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TaskManager = new TaskManager(ApplicationPaths, JsonSerializer, LoggerFactory, FileSystemManager);
|
|
|
|
serviceCollection.AddSingleton<ITaskManager, TaskManager>();
|
|
|
|
serviceCollection.AddSingleton(TaskManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(XmlSerializer);
|
|
|
|
serviceCollection.AddSingleton(_xmlSerializer);
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(typeof(IStreamHelper), typeof(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(typeof(IInstallationManager), typeof(InstallationManager));
|
|
|
|
serviceCollection.AddSingleton<IInstallationManager, InstallationManager>();
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(typeof(IZipClient), typeof(ZipClient));
|
|
|
|
serviceCollection.AddSingleton<IZipClient, ZipClient>();
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(typeof(IHttpResultFactory), typeof(HttpResultFactory));
|
|
|
|
serviceCollection.AddSingleton<IHttpResultFactory, HttpResultFactory>();
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IServerApplicationHost>(this);
|
|
|
|
serviceCollection.AddSingleton<IServerApplicationHost>(this);
|
|
|
|
serviceCollection.AddSingleton<IServerApplicationPaths>(ApplicationPaths);
|
|
|
|
serviceCollection.AddSingleton<IServerApplicationPaths>(ApplicationPaths);
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(ServerConfigurationManager);
|
|
|
|
serviceCollection.AddSingleton(ServerConfigurationManager);
|
|
|
|
|
|
|
|
|
|
|
|
LocalizationManager = new LocalizationManager(ServerConfigurationManager, JsonSerializer, LoggerFactory.CreateLogger<LocalizationManager>());
|
|
|
|
serviceCollection.AddSingleton<ILocalizationManager, LocalizationManager>();
|
|
|
|
await LocalizationManager.LoadAll().ConfigureAwait(false);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<ILocalizationManager>(LocalizationManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IBlurayExaminer>(new BdInfoExaminer(FileSystemManager));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UserDataManager = new UserDataManager(LoggerFactory, ServerConfigurationManager, () => UserManager);
|
|
|
|
serviceCollection.AddSingleton<IBlurayExaminer, BdInfoExaminer>();
|
|
|
|
serviceCollection.AddSingleton(UserDataManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_displayPreferencesRepository = new SqliteDisplayPreferencesRepository(
|
|
|
|
serviceCollection.AddSingleton<IUserDataRepository, SqliteUserDataRepository>();
|
|
|
|
LoggerFactory.CreateLogger<SqliteDisplayPreferencesRepository>(),
|
|
|
|
serviceCollection.AddSingleton<IUserDataManager, UserDataManager>();
|
|
|
|
ApplicationPaths,
|
|
|
|
|
|
|
|
FileSystemManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IDisplayPreferencesRepository>(_displayPreferencesRepository);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ItemRepository = new SqliteItemRepository(ServerConfigurationManager, this, LoggerFactory.CreateLogger<SqliteItemRepository>(), LocalizationManager);
|
|
|
|
serviceCollection.AddSingleton<IDisplayPreferencesRepository, SqliteDisplayPreferencesRepository>();
|
|
|
|
serviceCollection.AddSingleton<IItemRepository>(ItemRepository);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AuthenticationRepository = GetAuthenticationRepository();
|
|
|
|
serviceCollection.AddSingleton<IItemRepository, SqliteItemRepository>();
|
|
|
|
serviceCollection.AddSingleton(AuthenticationRepository);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_userRepository = GetUserRepository();
|
|
|
|
serviceCollection.AddSingleton<IAuthenticationRepository, AuthenticationRepository>();
|
|
|
|
|
|
|
|
|
|
|
|
UserManager = new UserManager(
|
|
|
|
serviceCollection.AddSingleton<IUserRepository, SqliteUserRepository>();
|
|
|
|
LoggerFactory.CreateLogger<UserManager>(),
|
|
|
|
|
|
|
|
_userRepository,
|
|
|
|
|
|
|
|
XmlSerializer,
|
|
|
|
|
|
|
|
NetworkManager,
|
|
|
|
|
|
|
|
() => ImageProcessor,
|
|
|
|
|
|
|
|
() => DtoService,
|
|
|
|
|
|
|
|
this,
|
|
|
|
|
|
|
|
JsonSerializer,
|
|
|
|
|
|
|
|
FileSystemManager,
|
|
|
|
|
|
|
|
cryptoProvider);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(UserManager);
|
|
|
|
// TODO: Refactor to eliminate the circular dependency here so that Lazy<T> isn't required
|
|
|
|
|
|
|
|
serviceCollection.AddTransient(provider => new Lazy<IDtoService>(provider.GetRequiredService<IDtoService>));
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IUserManager, UserManager>();
|
|
|
|
|
|
|
|
|
|
|
|
MediaEncoder = new MediaBrowser.MediaEncoding.Encoder.MediaEncoder(
|
|
|
|
// TODO: Refactor to eliminate the circular dependency here so that Lazy<T> isn't required
|
|
|
|
LoggerFactory.CreateLogger<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>(),
|
|
|
|
// TODO: Add StartupOptions.FFmpegPath to IConfiguration and remove this custom activation
|
|
|
|
ServerConfigurationManager,
|
|
|
|
serviceCollection.AddTransient(provider => new Lazy<EncodingHelper>(provider.GetRequiredService<EncodingHelper>));
|
|
|
|
FileSystemManager,
|
|
|
|
serviceCollection.AddSingleton<IMediaEncoder>(provider =>
|
|
|
|
LocalizationManager,
|
|
|
|
ActivatorUtilities.CreateInstance<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>(provider, _startupOptions.FFmpegPath ?? string.Empty));
|
|
|
|
() => SubtitleEncoder,
|
|
|
|
|
|
|
|
startupConfig,
|
|
|
|
|
|
|
|
StartupOptions.FFmpegPath);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(MediaEncoder);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LibraryManager = new LibraryManager(this, LoggerFactory, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => LibraryMonitor, FileSystemManager, () => ProviderManager, () => UserViewManager, MediaEncoder);
|
|
|
|
// TODO: Refactor to eliminate the circular dependencies here so that Lazy<T> isn't required
|
|
|
|
serviceCollection.AddSingleton(LibraryManager);
|
|
|
|
serviceCollection.AddTransient(provider => new Lazy<ILibraryMonitor>(provider.GetRequiredService<ILibraryMonitor>));
|
|
|
|
|
|
|
|
serviceCollection.AddTransient(provider => new Lazy<IProviderManager>(provider.GetRequiredService<IProviderManager>));
|
|
|
|
|
|
|
|
serviceCollection.AddTransient(provider => new Lazy<IUserViewManager>(provider.GetRequiredService<IUserViewManager>));
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<ILibraryManager, LibraryManager>();
|
|
|
|
|
|
|
|
|
|
|
|
var musicManager = new MusicManager(LibraryManager);
|
|
|
|
serviceCollection.AddSingleton<IMusicManager, MusicManager>();
|
|
|
|
serviceCollection.AddSingleton<IMusicManager>(musicManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LibraryMonitor = new LibraryMonitor(LoggerFactory, LibraryManager, ServerConfigurationManager, FileSystemManager);
|
|
|
|
serviceCollection.AddSingleton<ILibraryMonitor, LibraryMonitor>();
|
|
|
|
serviceCollection.AddSingleton(LibraryMonitor);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<ISearchEngine>(new SearchEngine(LoggerFactory, LibraryManager, UserManager));
|
|
|
|
serviceCollection.AddSingleton<ISearchEngine, SearchEngine>();
|
|
|
|
|
|
|
|
|
|
|
|
CertificateInfo = GetCertificateInfo(true);
|
|
|
|
|
|
|
|
Certificate = GetCertificate(CertificateInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<ServiceController>();
|
|
|
|
serviceCollection.AddSingleton<ServiceController>();
|
|
|
|
serviceCollection.AddSingleton<IHttpListener, WebSocketSharpListener>();
|
|
|
|
serviceCollection.AddSingleton<IHttpListener, WebSocketSharpListener>();
|
|
|
|
serviceCollection.AddSingleton<IHttpServer, HttpListenerHost>();
|
|
|
|
serviceCollection.AddSingleton<IHttpServer, HttpListenerHost>();
|
|
|
|
|
|
|
|
|
|
|
|
ImageProcessor = new ImageProcessor(LoggerFactory.CreateLogger<ImageProcessor>(), ServerConfigurationManager.ApplicationPaths, FileSystemManager, ImageEncoder, () => LibraryManager, () => MediaEncoder);
|
|
|
|
serviceCollection.AddSingleton<IImageProcessor, ImageProcessor>();
|
|
|
|
serviceCollection.AddSingleton(ImageProcessor);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TVSeriesManager = new TVSeriesManager(UserManager, UserDataManager, LibraryManager, ServerConfigurationManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(TVSeriesManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(DeviceManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MediaSourceManager = new MediaSourceManager(ItemRepository, ApplicationPaths, LocalizationManager, UserManager, LibraryManager, LoggerFactory, JsonSerializer, FileSystemManager, UserDataManager, () => MediaEncoder);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(MediaSourceManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SubtitleManager = new SubtitleManager(LoggerFactory, FileSystemManager, LibraryMonitor, MediaSourceManager, LocalizationManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(SubtitleManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ProviderManager = new ProviderManager(HttpClient, SubtitleManager, ServerConfigurationManager, LibraryMonitor, LoggerFactory, FileSystemManager, ApplicationPaths, () => LibraryManager, JsonSerializer);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(ProviderManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DtoService = new DtoService(LoggerFactory, LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ProviderManager, this, () => MediaSourceManager, () => LiveTvManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(DtoService);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ChannelManager = new ChannelManager(
|
|
|
|
|
|
|
|
UserManager,
|
|
|
|
|
|
|
|
DtoService,
|
|
|
|
|
|
|
|
LibraryManager,
|
|
|
|
|
|
|
|
LoggerFactory.CreateLogger<ChannelManager>(),
|
|
|
|
|
|
|
|
ServerConfigurationManager,
|
|
|
|
|
|
|
|
FileSystemManager,
|
|
|
|
|
|
|
|
UserDataManager,
|
|
|
|
|
|
|
|
JsonSerializer,
|
|
|
|
|
|
|
|
ProviderManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(ChannelManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SessionManager = new SessionManager(
|
|
|
|
|
|
|
|
LoggerFactory.CreateLogger<SessionManager>(),
|
|
|
|
|
|
|
|
UserDataManager,
|
|
|
|
|
|
|
|
LibraryManager,
|
|
|
|
|
|
|
|
UserManager,
|
|
|
|
|
|
|
|
musicManager,
|
|
|
|
|
|
|
|
DtoService,
|
|
|
|
|
|
|
|
ImageProcessor,
|
|
|
|
|
|
|
|
this,
|
|
|
|
|
|
|
|
AuthenticationRepository,
|
|
|
|
|
|
|
|
DeviceManager,
|
|
|
|
|
|
|
|
MediaSourceManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(SessionManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IDlnaManager>(
|
|
|
|
|
|
|
|
new DlnaManager(XmlSerializer, FileSystemManager, ApplicationPaths, LoggerFactory, JsonSerializer, this));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CollectionManager = new CollectionManager(LibraryManager, ApplicationPaths, LocalizationManager, FileSystemManager, LibraryMonitor, LoggerFactory, ProviderManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(CollectionManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(typeof(IPlaylistManager), typeof(PlaylistManager));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LiveTvManager = new LiveTvManager(this, ServerConfigurationManager, LoggerFactory, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer, FileSystemManager, () => ChannelManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(LiveTvManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, UserManager, ChannelManager, LiveTvManager, ServerConfigurationManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(UserViewManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NotificationManager = new NotificationManager(
|
|
|
|
|
|
|
|
LoggerFactory.CreateLogger<NotificationManager>(),
|
|
|
|
|
|
|
|
UserManager,
|
|
|
|
|
|
|
|
ServerConfigurationManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(NotificationManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IDeviceDiscovery>(new DeviceDiscovery(ServerConfigurationManager));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ChapterManager = new ChapterManager(ItemRepository);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(ChapterManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EncodingManager = new MediaEncoder.EncodingManager(
|
|
|
|
|
|
|
|
LoggerFactory.CreateLogger<MediaEncoder.EncodingManager>(),
|
|
|
|
|
|
|
|
FileSystemManager,
|
|
|
|
|
|
|
|
MediaEncoder,
|
|
|
|
|
|
|
|
ChapterManager,
|
|
|
|
|
|
|
|
LibraryManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(EncodingManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var activityLogRepo = GetActivityLogRepository();
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(activityLogRepo);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IActivityManager>(new ActivityManager(activityLogRepo, UserManager));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var authContext = new AuthorizationContext(AuthenticationRepository, UserManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IAuthorizationContext>(authContext);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<ISessionContext>(new SessionContext(UserManager, authContext, SessionManager));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AuthService = new AuthService(LoggerFactory.CreateLogger<AuthService>(), authContext, ServerConfigurationManager, SessionManager, NetworkManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(AuthService);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SubtitleEncoder = new MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder(
|
|
|
|
|
|
|
|
LibraryManager,
|
|
|
|
|
|
|
|
LoggerFactory.CreateLogger<MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder>(),
|
|
|
|
|
|
|
|
ApplicationPaths,
|
|
|
|
|
|
|
|
FileSystemManager,
|
|
|
|
|
|
|
|
MediaEncoder,
|
|
|
|
|
|
|
|
HttpClient,
|
|
|
|
|
|
|
|
MediaSourceManager);
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(SubtitleEncoder);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(typeof(IResourceFileManager), typeof(ResourceFileManager));
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<EncodingHelper>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton(typeof(IAttachmentExtractor), typeof(MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor));
|
|
|
|
serviceCollection.AddSingleton<ITVSeriesManager, TVSeriesManager>();
|
|
|
|
|
|
|
|
|
|
|
|
_displayPreferencesRepository.Initialize();
|
|
|
|
serviceCollection.AddSingleton<IDeviceManager, DeviceManager>();
|
|
|
|
|
|
|
|
|
|
|
|
var userDataRepo = new SqliteUserDataRepository(LoggerFactory.CreateLogger<SqliteUserDataRepository>(), ApplicationPaths);
|
|
|
|
serviceCollection.AddSingleton<IMediaSourceManager, MediaSourceManager>();
|
|
|
|
|
|
|
|
|
|
|
|
SetStaticProperties();
|
|
|
|
serviceCollection.AddSingleton<ISubtitleManager, SubtitleManager>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IProviderManager, ProviderManager>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Refactor to eliminate the circular dependency here so that Lazy<T> isn't required
|
|
|
|
|
|
|
|
serviceCollection.AddTransient(provider => new Lazy<ILiveTvManager>(provider.GetRequiredService<ILiveTvManager>));
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IDtoService, DtoService>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IChannelManager, ChannelManager>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<ISessionManager, SessionManager>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IDlnaManager, DlnaManager>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<ICollectionManager, CollectionManager>();
|
|
|
|
|
|
|
|
|
|
|
|
((UserManager)UserManager).Initialize();
|
|
|
|
serviceCollection.AddSingleton<IPlaylistManager, PlaylistManager>();
|
|
|
|
|
|
|
|
|
|
|
|
((UserDataManager)UserDataManager).Repository = userDataRepo;
|
|
|
|
serviceCollection.AddSingleton<LiveTvDtoService>();
|
|
|
|
ItemRepository.Initialize(userDataRepo, UserManager);
|
|
|
|
serviceCollection.AddSingleton<ILiveTvManager, LiveTvManager>();
|
|
|
|
((LibraryManager)LibraryManager).ItemRepository = ItemRepository;
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IUserViewManager, UserViewManager>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<INotificationManager, NotificationManager>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IDeviceDiscovery, DeviceDiscovery>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IChapterManager, ChapterManager>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IEncodingManager, MediaEncoder.EncodingManager>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IActivityRepository, ActivityRepository>();
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IActivityManager, ActivityManager>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IAuthorizationContext, AuthorizationContext>();
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<ISessionContext, SessionContext>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IAuthService, AuthService>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<ISubtitleEncoder, MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IResourceFileManager, ResourceFileManager>();
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<EncodingHelper>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IAttachmentExtractor, MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Create services registered with the service container that need to be initialized at application startup.
|
|
|
|
/// Create services registered with the service container that need to be initialized at application startup.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public void InitializeServices()
|
|
|
|
/// <returns>A task representing the service initialization operation.</returns>
|
|
|
|
|
|
|
|
public async Task InitializeServices()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
HttpServer = Resolve<IHttpServer>();
|
|
|
|
var localizationManager = (LocalizationManager)Resolve<ILocalizationManager>();
|
|
|
|
|
|
|
|
await localizationManager.LoadAll().ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_mediaEncoder = Resolve<IMediaEncoder>();
|
|
|
|
|
|
|
|
_sessionManager = Resolve<ISessionManager>();
|
|
|
|
|
|
|
|
_httpServer = Resolve<IHttpServer>();
|
|
|
|
|
|
|
|
_httpClient = Resolve<IHttpClient>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
((SqliteDisplayPreferencesRepository)Resolve<IDisplayPreferencesRepository>()).Initialize();
|
|
|
|
|
|
|
|
((AuthenticationRepository)Resolve<IAuthenticationRepository>()).Initialize();
|
|
|
|
|
|
|
|
((SqliteUserRepository)Resolve<IUserRepository>()).Initialize();
|
|
|
|
|
|
|
|
((ActivityRepository)Resolve<IActivityRepository>()).Initialize();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetStaticProperties();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var userManager = (UserManager)Resolve<IUserManager>();
|
|
|
|
|
|
|
|
userManager.Initialize();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var userDataRepo = (SqliteUserDataRepository)Resolve<IUserDataRepository>();
|
|
|
|
|
|
|
|
((SqliteItemRepository)Resolve<IItemRepository>()).Initialize(userDataRepo, userManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FindParts();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths)
|
|
|
|
public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths)
|
|
|
@ -940,75 +768,38 @@ namespace Emby.Server.Implementations
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets the user repository.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <returns><see cref="Task{SqliteUserRepository}" />.</returns>
|
|
|
|
|
|
|
|
private SqliteUserRepository GetUserRepository()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var repo = new SqliteUserRepository(
|
|
|
|
|
|
|
|
LoggerFactory.CreateLogger<SqliteUserRepository>(),
|
|
|
|
|
|
|
|
ApplicationPaths);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
repo.Initialize();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return repo;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IAuthenticationRepository GetAuthenticationRepository()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var repo = new AuthenticationRepository(LoggerFactory, ServerConfigurationManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
repo.Initialize();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return repo;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IActivityRepository GetActivityLogRepository()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var repo = new ActivityRepository(LoggerFactory.CreateLogger<ActivityRepository>(), ServerConfigurationManager.ApplicationPaths, FileSystemManager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
repo.Initialize();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return repo;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Dirty hacks.
|
|
|
|
/// Dirty hacks.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
private void SetStaticProperties()
|
|
|
|
private void SetStaticProperties()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ItemRepository.ImageProcessor = ImageProcessor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// For now there's no real way to inject these properly
|
|
|
|
// For now there's no real way to inject these properly
|
|
|
|
BaseItem.Logger = LoggerFactory.CreateLogger("BaseItem");
|
|
|
|
BaseItem.Logger = Resolve<ILogger<BaseItem>>();
|
|
|
|
BaseItem.ConfigurationManager = ServerConfigurationManager;
|
|
|
|
BaseItem.ConfigurationManager = ServerConfigurationManager;
|
|
|
|
BaseItem.LibraryManager = LibraryManager;
|
|
|
|
BaseItem.LibraryManager = Resolve<ILibraryManager>();
|
|
|
|
BaseItem.ProviderManager = ProviderManager;
|
|
|
|
BaseItem.ProviderManager = Resolve<IProviderManager>();
|
|
|
|
BaseItem.LocalizationManager = LocalizationManager;
|
|
|
|
BaseItem.LocalizationManager = Resolve<ILocalizationManager>();
|
|
|
|
BaseItem.ItemRepository = ItemRepository;
|
|
|
|
BaseItem.ItemRepository = Resolve<IItemRepository>();
|
|
|
|
User.UserManager = UserManager;
|
|
|
|
User.UserManager = Resolve<IUserManager>();
|
|
|
|
BaseItem.FileSystem = FileSystemManager;
|
|
|
|
BaseItem.FileSystem = _fileSystemManager;
|
|
|
|
BaseItem.UserDataManager = UserDataManager;
|
|
|
|
BaseItem.UserDataManager = Resolve<IUserDataManager>();
|
|
|
|
BaseItem.ChannelManager = ChannelManager;
|
|
|
|
BaseItem.ChannelManager = Resolve<IChannelManager>();
|
|
|
|
Video.LiveTvManager = LiveTvManager;
|
|
|
|
Video.LiveTvManager = Resolve<ILiveTvManager>();
|
|
|
|
Folder.UserViewManager = UserViewManager;
|
|
|
|
Folder.UserViewManager = Resolve<IUserViewManager>();
|
|
|
|
UserView.TVSeriesManager = TVSeriesManager;
|
|
|
|
UserView.TVSeriesManager = Resolve<ITVSeriesManager>();
|
|
|
|
UserView.CollectionManager = CollectionManager;
|
|
|
|
UserView.CollectionManager = Resolve<ICollectionManager>();
|
|
|
|
BaseItem.MediaSourceManager = MediaSourceManager;
|
|
|
|
BaseItem.MediaSourceManager = Resolve<IMediaSourceManager>();
|
|
|
|
CollectionFolder.XmlSerializer = XmlSerializer;
|
|
|
|
CollectionFolder.XmlSerializer = _xmlSerializer;
|
|
|
|
CollectionFolder.JsonSerializer = JsonSerializer;
|
|
|
|
CollectionFolder.JsonSerializer = Resolve<IJsonSerializer>();
|
|
|
|
CollectionFolder.ApplicationHost = this;
|
|
|
|
CollectionFolder.ApplicationHost = this;
|
|
|
|
AuthenticatedAttribute.AuthService = AuthService;
|
|
|
|
AuthenticatedAttribute.AuthService = Resolve<IAuthService>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Finds the parts.
|
|
|
|
/// Finds plugin components and register them with the appropriate services.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public void FindParts()
|
|
|
|
private void FindParts()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InstallationManager = ServiceProvider.GetService<IInstallationManager>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ServerConfigurationManager.Configuration.IsPortAuthorized)
|
|
|
|
if (!ServerConfigurationManager.Configuration.IsPortAuthorized)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ServerConfigurationManager.Configuration.IsPortAuthorized = true;
|
|
|
|
ServerConfigurationManager.Configuration.IsPortAuthorized = true;
|
|
|
@ -1021,34 +812,34 @@ namespace Emby.Server.Implementations
|
|
|
|
.Where(i => i != null)
|
|
|
|
.Where(i => i != null)
|
|
|
|
.ToArray();
|
|
|
|
.ToArray();
|
|
|
|
|
|
|
|
|
|
|
|
HttpServer.Init(GetExportTypes<IService>(), GetExports<IWebSocketListener>(), GetUrlPrefixes());
|
|
|
|
_httpServer.Init(GetExportTypes<IService>(), GetExports<IWebSocketListener>(), GetUrlPrefixes());
|
|
|
|
|
|
|
|
|
|
|
|
LibraryManager.AddParts(
|
|
|
|
Resolve<ILibraryManager>().AddParts(
|
|
|
|
GetExports<IResolverIgnoreRule>(),
|
|
|
|
GetExports<IResolverIgnoreRule>(),
|
|
|
|
GetExports<IItemResolver>(),
|
|
|
|
GetExports<IItemResolver>(),
|
|
|
|
GetExports<IIntroProvider>(),
|
|
|
|
GetExports<IIntroProvider>(),
|
|
|
|
GetExports<IBaseItemComparer>(),
|
|
|
|
GetExports<IBaseItemComparer>(),
|
|
|
|
GetExports<ILibraryPostScanTask>());
|
|
|
|
GetExports<ILibraryPostScanTask>());
|
|
|
|
|
|
|
|
|
|
|
|
ProviderManager.AddParts(
|
|
|
|
Resolve<IProviderManager>().AddParts(
|
|
|
|
GetExports<IImageProvider>(),
|
|
|
|
GetExports<IImageProvider>(),
|
|
|
|
GetExports<IMetadataService>(),
|
|
|
|
GetExports<IMetadataService>(),
|
|
|
|
GetExports<IMetadataProvider>(),
|
|
|
|
GetExports<IMetadataProvider>(),
|
|
|
|
GetExports<IMetadataSaver>(),
|
|
|
|
GetExports<IMetadataSaver>(),
|
|
|
|
GetExports<IExternalId>());
|
|
|
|
GetExports<IExternalId>());
|
|
|
|
|
|
|
|
|
|
|
|
LiveTvManager.AddParts(GetExports<ILiveTvService>(), GetExports<ITunerHost>(), GetExports<IListingsProvider>());
|
|
|
|
Resolve<ILiveTvManager>().AddParts(GetExports<ILiveTvService>(), GetExports<ITunerHost>(), GetExports<IListingsProvider>());
|
|
|
|
|
|
|
|
|
|
|
|
SubtitleManager.AddParts(GetExports<ISubtitleProvider>());
|
|
|
|
Resolve<ISubtitleManager>().AddParts(GetExports<ISubtitleProvider>());
|
|
|
|
|
|
|
|
|
|
|
|
ChannelManager.AddParts(GetExports<IChannel>());
|
|
|
|
Resolve<IChannelManager>().AddParts(GetExports<IChannel>());
|
|
|
|
|
|
|
|
|
|
|
|
MediaSourceManager.AddParts(GetExports<IMediaSourceProvider>());
|
|
|
|
Resolve<IMediaSourceManager>().AddParts(GetExports<IMediaSourceProvider>());
|
|
|
|
|
|
|
|
|
|
|
|
NotificationManager.AddParts(GetExports<INotificationService>(), GetExports<INotificationTypeFactory>());
|
|
|
|
Resolve<INotificationManager>().AddParts(GetExports<INotificationService>(), GetExports<INotificationTypeFactory>());
|
|
|
|
UserManager.AddParts(GetExports<IAuthenticationProvider>(), GetExports<IPasswordResetProvider>());
|
|
|
|
Resolve<IUserManager>().AddParts(GetExports<IAuthenticationProvider>(), GetExports<IPasswordResetProvider>());
|
|
|
|
|
|
|
|
|
|
|
|
IsoManager.AddParts(GetExports<IIsoMounter>());
|
|
|
|
Resolve<IIsoManager>().AddParts(GetExports<IIsoMounter>());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private IPlugin LoadPlugin(IPlugin plugin)
|
|
|
|
private IPlugin LoadPlugin(IPlugin plugin)
|
|
|
@ -1155,16 +946,6 @@ namespace Emby.Server.Implementations
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private CertificateInfo GetCertificateInfo(bool generateCertificate)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Custom cert
|
|
|
|
|
|
|
|
return new CertificateInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Path = ServerConfigurationManager.Configuration.CertificatePath,
|
|
|
|
|
|
|
|
Password = ServerConfigurationManager.Configuration.CertificatePassword
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Called when [configuration updated].
|
|
|
|
/// Called when [configuration updated].
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -1191,14 +972,13 @@ namespace Emby.Server.Implementations
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!HttpServer.UrlPrefixes.SequenceEqual(GetUrlPrefixes(), StringComparer.OrdinalIgnoreCase))
|
|
|
|
if (!_httpServer.UrlPrefixes.SequenceEqual(GetUrlPrefixes(), StringComparer.OrdinalIgnoreCase))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
requiresRestart = true;
|
|
|
|
requiresRestart = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var currentCertPath = CertificateInfo?.Path;
|
|
|
|
var currentCertPath = CertificateInfo?.Path;
|
|
|
|
var newCertInfo = GetCertificateInfo(false);
|
|
|
|
var newCertPath = ServerConfigurationManager.Configuration.CertificatePath;
|
|
|
|
var newCertPath = newCertInfo?.Path;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.Equals(currentCertPath, newCertPath, StringComparison.OrdinalIgnoreCase))
|
|
|
|
if (!string.Equals(currentCertPath, newCertPath, StringComparison.OrdinalIgnoreCase))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1251,7 +1031,7 @@ namespace Emby.Server.Implementations
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await SessionManager.SendServerRestartNotification(CancellationToken.None).ConfigureAwait(false);
|
|
|
|
await _sessionManager.SendServerRestartNotification(CancellationToken.None).ConfigureAwait(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1355,7 +1135,7 @@ namespace Emby.Server.Implementations
|
|
|
|
IsShuttingDown = IsShuttingDown,
|
|
|
|
IsShuttingDown = IsShuttingDown,
|
|
|
|
Version = ApplicationVersionString,
|
|
|
|
Version = ApplicationVersionString,
|
|
|
|
WebSocketPortNumber = HttpPort,
|
|
|
|
WebSocketPortNumber = HttpPort,
|
|
|
|
CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(),
|
|
|
|
CompletedInstallations = Resolve<IInstallationManager>().CompletedInstallations.ToArray(),
|
|
|
|
Id = SystemId,
|
|
|
|
Id = SystemId,
|
|
|
|
ProgramDataPath = ApplicationPaths.ProgramDataPath,
|
|
|
|
ProgramDataPath = ApplicationPaths.ProgramDataPath,
|
|
|
|
WebPath = ApplicationPaths.WebPath,
|
|
|
|
WebPath = ApplicationPaths.WebPath,
|
|
|
@ -1375,14 +1155,14 @@ namespace Emby.Server.Implementations
|
|
|
|
ServerName = FriendlyName,
|
|
|
|
ServerName = FriendlyName,
|
|
|
|
LocalAddress = localAddress,
|
|
|
|
LocalAddress = localAddress,
|
|
|
|
SupportsLibraryMonitor = true,
|
|
|
|
SupportsLibraryMonitor = true,
|
|
|
|
EncoderLocation = MediaEncoder.EncoderLocation,
|
|
|
|
EncoderLocation = _mediaEncoder.EncoderLocation,
|
|
|
|
SystemArchitecture = RuntimeInformation.OSArchitecture,
|
|
|
|
SystemArchitecture = RuntimeInformation.OSArchitecture,
|
|
|
|
PackageName = StartupOptions.PackageName
|
|
|
|
PackageName = _startupOptions.PackageName
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IEnumerable<WakeOnLanInfo> GetWakeOnLanInfo()
|
|
|
|
public IEnumerable<WakeOnLanInfo> GetWakeOnLanInfo()
|
|
|
|
=> NetworkManager.GetMacAddresses()
|
|
|
|
=> _networkManager.GetMacAddresses()
|
|
|
|
.Select(i => new WakeOnLanInfo(i))
|
|
|
|
.Select(i => new WakeOnLanInfo(i))
|
|
|
|
.ToList();
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
|
@ -1494,7 +1274,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
|
|
|
|
|
|
if (addresses.Count == 0)
|
|
|
|
if (addresses.Count == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
addresses.AddRange(NetworkManager.GetLocalIpAddresses(ServerConfigurationManager.Configuration.IgnoreVirtualInterfaces));
|
|
|
|
addresses.AddRange(_networkManager.GetLocalIpAddresses(ServerConfigurationManager.Configuration.IgnoreVirtualInterfaces));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var resultList = new List<IPAddress>();
|
|
|
|
var resultList = new List<IPAddress>();
|
|
|
@ -1561,7 +1341,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
using (var response = await HttpClient.SendAsync(
|
|
|
|
using (var response = await _httpClient.SendAsync(
|
|
|
|
new HttpRequestOptions
|
|
|
|
new HttpRequestOptions
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Url = apiUrl,
|
|
|
|
Url = apiUrl,
|
|
|
@ -1614,7 +1394,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await SessionManager.SendServerShutdownNotification(CancellationToken.None).ConfigureAwait(false);
|
|
|
|
await _sessionManager.SendServerShutdownNotification(CancellationToken.None).ConfigureAwait(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1735,14 +1515,8 @@ namespace Emby.Server.Implementations
|
|
|
|
Logger.LogError(ex, "Error disposing {Type}", part.GetType().Name);
|
|
|
|
Logger.LogError(ex, "Error disposing {Type}", part.GetType().Name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_userRepository?.Dispose();
|
|
|
|
|
|
|
|
_displayPreferencesRepository?.Dispose();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_userRepository = null;
|
|
|
|
|
|
|
|
_displayPreferencesRepository = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_disposed = true;
|
|
|
|
_disposed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|