| 
					
				 | 
			
			
				@@ -86,7 +86,6 @@ using MediaBrowser.Model.Activity; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using MediaBrowser.Model.Configuration; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using MediaBrowser.Model.Cryptography; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using MediaBrowser.Model.Dlna; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using MediaBrowser.Model.Events; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using MediaBrowser.Model.Globalization; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using MediaBrowser.Model.IO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using MediaBrowser.Model.MediaInfo; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -104,7 +103,6 @@ using MediaBrowser.WebDashboard.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using MediaBrowser.XbmcMetadata.Providers; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using Microsoft.AspNetCore.Http; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using Microsoft.AspNetCore.Http.Extensions; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using Microsoft.Extensions.Configuration; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using Microsoft.Extensions.DependencyInjection; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using Microsoft.Extensions.Logging; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using OperatingSystem = MediaBrowser.Common.System.OperatingSystem; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -121,14 +119,20 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private static readonly string[] _relevantEnvVarPrefixes = { "JELLYFIN_", "DOTNET_", "ASPNETCORE_" }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        private SqliteUserRepository _userRepository; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        private SqliteDisplayPreferencesRepository _displayPreferencesRepository; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private readonly IFileSystem _fileSystemManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// Gets a value indicating whether this instance can self restart. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        public abstract bool CanSelfRestart { get; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public bool CanSelfRestart => _startupOptions.RestartPath != null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public virtual bool CanLaunchWebBrowser 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -139,7 +143,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (StartupOptions.IsService) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (_startupOptions.IsService) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -209,21 +213,6 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <value>The configuration manager.</value> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         protected IConfigurationManager ConfigurationManager { get; set; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        public IFileSystem FileSystemManager { get; set; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /// <inheritdoc /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        public PackageVersionClass SystemUpdateLevel 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            get 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-#if BETA 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                return PackageVersionClass.Beta; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-#else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                return PackageVersionClass.Release; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-#endif 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// Gets or sets the service provider. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </summary> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -245,110 +234,6 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <value>The server configuration manager.</value> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// Initializes a new instance of the <see cref="ApplicationHost" /> class. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </summary> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -357,29 +242,33 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ILoggerFactory loggerFactory, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             IStartupOptions options, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             IFileSystem fileSystem, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            IImageEncoder imageEncoder, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             INetworkManager networkManager) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            XmlSerializer = new MyXmlSerializer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _xmlSerializer = new MyXmlSerializer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            NetworkManager = networkManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _networkManager = networkManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             networkManager.LocalSubnetsFn = GetConfiguredLocalSubnets; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ApplicationPaths = applicationPaths; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             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; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ImageEncoder = imageEncoder; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _startupOptions = options; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             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) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -447,10 +336,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /// Gets the name. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /// <value>The name.</value> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <inheritdoc/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public string Name => ApplicationProductName; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <summary> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -540,7 +426,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ConfigurationManager.ConfigurationUpdated += OnConfigurationUpdated; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            MediaEncoder.SetFFmpegPath(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _mediaEncoder.SetFFmpegPath(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Logger.LogInformation("ServerId: {0}", SystemId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -552,7 +438,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Logger.LogInformation("Executed all pre-startup entry points in {Elapsed:g}", stopWatch.Elapsed); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Logger.LogInformation("Core startup complete"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            HttpServer.GlobalResponse = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _httpServer.GlobalResponse = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             stopWatch.Restart(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             await Task.WhenAll(StartEntryPoints(entryPoints, false)).ConfigureAwait(false); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -576,7 +462,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <inheritdoc/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        public async Task InitAsync(IServiceCollection serviceCollection, IConfiguration startupConfig) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public void Init(IServiceCollection serviceCollection) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             HttpPort = ServerConfigurationManager.Configuration.HttpServerPortNumber; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             HttpsPort = ServerConfigurationManager.Configuration.HttpsPortNumber; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -588,8 +474,6 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 HttpsPort = ServerConfiguration.DefaultHttpsPort; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            JsonSerializer = new JsonSerializer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (Plugins != null) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 var pluginBuilder = new StringBuilder(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -609,7 +493,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             DiscoverTypes(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            await RegisterServices(serviceCollection, startupConfig).ConfigureAwait(false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            RegisterServices(serviceCollection); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public async Task ExecuteWebsocketHandlerAsync(HttpContext context, Func<Task> next) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -620,7 +504,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            await HttpServer.ProcessWebSocketRequest(context).ConfigureAwait(false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            await _httpServer.ProcessWebSocketRequest(context).ConfigureAwait(false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public async Task ExecuteHttpHandlerAsync(HttpContext context, Func<Task> next) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -636,14 +520,16 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var localPath = context.Request.Path.ToString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// Registers services/resources with the service collection that will be available via DI. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        protected async Task RegisterServices(IServiceCollection serviceCollection, IConfiguration startupConfig) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        protected virtual void RegisterServices(IServiceCollection serviceCollection) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton(_startupOptions); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             serviceCollection.AddMemoryCache(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             serviceCollection.AddSingleton(ConfigurationManager); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -651,240 +537,169 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             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 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton<ILogger>(Logger); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // TODO: Remove support for injecting ILogger completely 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            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>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            HttpClient = new HttpClientManager.HttpClientManager( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                ApplicationPaths, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                LoggerFactory.CreateLogger<HttpClientManager.HttpClientManager>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                FileSystemManager, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                () => ApplicationUserAgent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton(HttpClient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IHttpClient, HttpClientManager.HttpClientManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton(NetworkManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton(_networkManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            IsoManager = new IsoManager(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton(IsoManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IIsoManager, IsoManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            TaskManager = new TaskManager(ApplicationPaths, JsonSerializer, LoggerFactory, FileSystemManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton(TaskManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<ITaskManager, TaskManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton(XmlSerializer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton(_xmlSerializer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton(typeof(IStreamHelper), typeof(StreamHelper)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IStreamHelper, StreamHelper>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            var cryptoProvider = new CryptographyProvider(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton<ICryptoProvider>(cryptoProvider); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<ICryptoProvider, CryptographyProvider>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            SocketFactory = new SocketFactory(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton(SocketFactory); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<ISocketFactory, 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<IServerApplicationPaths>(ApplicationPaths); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             serviceCollection.AddSingleton(ServerConfigurationManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LocalizationManager = new LocalizationManager(ServerConfigurationManager, JsonSerializer, LoggerFactory.CreateLogger<LocalizationManager>()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            await LocalizationManager.LoadAll().ConfigureAwait(false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton<ILocalizationManager>(LocalizationManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton<IBlurayExaminer>(new BdInfoExaminer(FileSystemManager)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<ILocalizationManager, LocalizationManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            UserDataManager = new UserDataManager(LoggerFactory, ServerConfigurationManager, () => UserManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton(UserDataManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IBlurayExaminer, BdInfoExaminer>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            _displayPreferencesRepository = new SqliteDisplayPreferencesRepository( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                LoggerFactory.CreateLogger<SqliteDisplayPreferencesRepository>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                ApplicationPaths, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                FileSystemManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton<IDisplayPreferencesRepository>(_displayPreferencesRepository); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IUserDataRepository, SqliteUserDataRepository>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IUserDataManager, UserDataManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ItemRepository = new SqliteItemRepository(ServerConfigurationManager, this, LoggerFactory.CreateLogger<SqliteItemRepository>(), LocalizationManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton<IItemRepository>(ItemRepository); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IDisplayPreferencesRepository, SqliteDisplayPreferencesRepository>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            AuthenticationRepository = GetAuthenticationRepository(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton(AuthenticationRepository); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IItemRepository, SqliteItemRepository>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            _userRepository = GetUserRepository(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IAuthenticationRepository, AuthenticationRepository>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            UserManager = new UserManager( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                LoggerFactory.CreateLogger<UserManager>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                _userRepository, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                XmlSerializer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                NetworkManager, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                () => ImageProcessor, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                () => DtoService, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                this, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                JsonSerializer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                FileSystemManager, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                cryptoProvider); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IUserRepository, SqliteUserRepository>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            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( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                LoggerFactory.CreateLogger<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                ServerConfigurationManager, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                FileSystemManager, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                LocalizationManager, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                () => SubtitleEncoder, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                startupConfig, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                StartupOptions.FFmpegPath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton(MediaEncoder); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // TODO: Refactor to eliminate the circular dependency here so that Lazy<T> isn't required 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // TODO: Add StartupOptions.FFmpegPath to IConfiguration and remove this custom activation 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddTransient(provider => new Lazy<EncodingHelper>(provider.GetRequiredService<EncodingHelper>)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IMediaEncoder>(provider => 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                ActivatorUtilities.CreateInstance<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>(provider, _startupOptions.FFmpegPath ?? string.Empty)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LibraryManager = new LibraryManager(this, LoggerFactory, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => LibraryMonitor, FileSystemManager, () => ProviderManager, () => UserViewManager, MediaEncoder); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton(LibraryManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // TODO: Refactor to eliminate the circular dependencies here so that Lazy<T> isn't required 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            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(LibraryMonitor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<ILibraryMonitor, LibraryMonitor>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            serviceCollection.AddSingleton<ISearchEngine>(new SearchEngine(LoggerFactory, LibraryManager, UserManager)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            CertificateInfo = GetCertificateInfo(true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Certificate = GetCertificate(CertificateInfo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<ISearchEngine, SearchEngine>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             serviceCollection.AddSingleton<ServiceController>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             serviceCollection.AddSingleton<IHttpListener, WebSocketSharpListener>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             serviceCollection.AddSingleton<IHttpServer, HttpListenerHost>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ImageProcessor = new ImageProcessor(LoggerFactory.CreateLogger<ImageProcessor>(), ServerConfigurationManager.ApplicationPaths, FileSystemManager, ImageEncoder, () => LibraryManager, () => MediaEncoder); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            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<IImageProcessor, ImageProcessor>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            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>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ((UserManager)UserManager).Initialize(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IDlnaManager, DlnaManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ((UserDataManager)UserDataManager).Repository = userDataRepo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ItemRepository.Initialize(userDataRepo, UserManager); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ((LibraryManager)LibraryManager).ItemRepository = ItemRepository; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<ICollectionManager, CollectionManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<IPlaylistManager, PlaylistManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<LiveTvDtoService>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            serviceCollection.AddSingleton<ILiveTvManager, LiveTvManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// Create services registered with the service container that need to be initialized at application startup. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </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) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -953,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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// Dirty hacks. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private void SetStaticProperties() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ItemRepository.ImageProcessor = ImageProcessor; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 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.LibraryManager = LibraryManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            BaseItem.ProviderManager = ProviderManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            BaseItem.LocalizationManager = LocalizationManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            BaseItem.ItemRepository = ItemRepository; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            User.UserManager = UserManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            BaseItem.FileSystem = FileSystemManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            BaseItem.UserDataManager = UserDataManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            BaseItem.ChannelManager = ChannelManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Video.LiveTvManager = LiveTvManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Folder.UserViewManager = UserViewManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            UserView.TVSeriesManager = TVSeriesManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            UserView.CollectionManager = CollectionManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            BaseItem.MediaSourceManager = MediaSourceManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            CollectionFolder.XmlSerializer = XmlSerializer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            CollectionFolder.JsonSerializer = JsonSerializer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            BaseItem.LibraryManager = Resolve<ILibraryManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            BaseItem.ProviderManager = Resolve<IProviderManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            BaseItem.LocalizationManager = Resolve<ILocalizationManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            BaseItem.ItemRepository = Resolve<IItemRepository>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            User.UserManager = Resolve<IUserManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            BaseItem.FileSystem = _fileSystemManager; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            BaseItem.UserDataManager = Resolve<IUserDataManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            BaseItem.ChannelManager = Resolve<IChannelManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Video.LiveTvManager = Resolve<ILiveTvManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Folder.UserViewManager = Resolve<IUserViewManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            UserView.TVSeriesManager = Resolve<ITVSeriesManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            UserView.CollectionManager = Resolve<ICollectionManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            BaseItem.MediaSourceManager = Resolve<IMediaSourceManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            CollectionFolder.XmlSerializer = _xmlSerializer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            CollectionFolder.JsonSerializer = Resolve<IJsonSerializer>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             CollectionFolder.ApplicationHost = this; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            AuthenticatedAttribute.AuthService = AuthService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AuthenticatedAttribute.AuthService = Resolve<IAuthService>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /// Finds the parts. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// Finds plugin components and register them with the appropriate services. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        public void FindParts() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private void FindParts() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            InstallationManager = ServiceProvider.GetService<IInstallationManager>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!ServerConfigurationManager.Configuration.IsPortAuthorized) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 ServerConfigurationManager.Configuration.IsPortAuthorized = true; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1034,34 +812,34 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .Where(i => i != null) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .ToArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            HttpServer.Init(GetExportTypes<IService>(), GetExports<IWebSocketListener>(), GetUrlPrefixes()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _httpServer.Init(GetExportTypes<IService>(), GetExports<IWebSocketListener>(), GetUrlPrefixes()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LibraryManager.AddParts( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Resolve<ILibraryManager>().AddParts( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 GetExports<IResolverIgnoreRule>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 GetExports<IItemResolver>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 GetExports<IIntroProvider>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 GetExports<IBaseItemComparer>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 GetExports<ILibraryPostScanTask>()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ProviderManager.AddParts( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Resolve<IProviderManager>().AddParts( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 GetExports<IImageProvider>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 GetExports<IMetadataService>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 GetExports<IMetadataProvider>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 GetExports<IMetadataSaver>(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 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>()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            UserManager.AddParts(GetExports<IAuthenticationProvider>(), GetExports<IPasswordResetProvider>()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Resolve<INotificationManager>().AddParts(GetExports<INotificationService>(), GetExports<INotificationTypeFactory>()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Resolve<IUserManager>().AddParts(GetExports<IAuthenticationProvider>(), GetExports<IPasswordResetProvider>()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            IsoManager.AddParts(GetExports<IIsoMounter>()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Resolve<IIsoManager>().AddParts(GetExports<IIsoMounter>()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private IPlugin LoadPlugin(IPlugin plugin) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1168,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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// Called when [configuration updated]. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </summary> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1204,14 +972,13 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (!HttpServer.UrlPrefixes.SequenceEqual(GetUrlPrefixes(), StringComparer.OrdinalIgnoreCase)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (!_httpServer.UrlPrefixes.SequenceEqual(GetUrlPrefixes(), StringComparer.OrdinalIgnoreCase)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 requiresRestart = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var currentCertPath = CertificateInfo?.Path; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            var newCertInfo = GetCertificateInfo(false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            var newCertPath = newCertInfo?.Path; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            var newCertPath = ServerConfigurationManager.Configuration.CertificatePath; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!string.Equals(currentCertPath, newCertPath, StringComparison.OrdinalIgnoreCase)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1264,7 +1031,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 try 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    await SessionManager.SendServerRestartNotification(CancellationToken.None).ConfigureAwait(false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    await _sessionManager.SendServerRestartNotification(CancellationToken.None).ConfigureAwait(false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 catch (Exception ex) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1368,7 +1135,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 IsShuttingDown = IsShuttingDown, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Version = ApplicationVersionString, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 WebSocketPortNumber = HttpPort, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                CompletedInstallations = Resolve<IInstallationManager>().CompletedInstallations.ToArray(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Id = SystemId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 ProgramDataPath = ApplicationPaths.ProgramDataPath, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 WebPath = ApplicationPaths.WebPath, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1388,15 +1155,14 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 ServerName = FriendlyName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 LocalAddress = localAddress, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 SupportsLibraryMonitor = true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                EncoderLocation = MediaEncoder.EncoderLocation, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                EncoderLocation = _mediaEncoder.EncoderLocation, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 SystemArchitecture = RuntimeInformation.OSArchitecture, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                SystemUpdateLevel = SystemUpdateLevel, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                PackageName = StartupOptions.PackageName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                PackageName = _startupOptions.PackageName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public IEnumerable<WakeOnLanInfo> GetWakeOnLanInfo() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            => NetworkManager.GetMacAddresses() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            => _networkManager.GetMacAddresses() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .Select(i => new WakeOnLanInfo(i)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1508,7 +1274,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (addresses.Count == 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                addresses.AddRange(NetworkManager.GetLocalIpAddresses(ServerConfigurationManager.Configuration.IgnoreVirtualInterfaces)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                addresses.AddRange(_networkManager.GetLocalIpAddresses(ServerConfigurationManager.Configuration.IgnoreVirtualInterfaces)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var resultList = new List<IPAddress>(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1575,7 +1341,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             try 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                using (var response = await HttpClient.SendAsync( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                using (var response = await _httpClient.SendAsync( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     new HttpRequestOptions 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Url = apiUrl, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1628,7 +1394,7 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             try 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                await SessionManager.SendServerShutdownNotification(CancellationToken.None).ConfigureAwait(false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                await _sessionManager.SendServerShutdownNotification(CancellationToken.None).ConfigureAwait(false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             catch (Exception ex) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1749,14 +1515,8 @@ namespace Emby.Server.Implementations 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Logger.LogError(ex, "Error disposing {Type}", part.GetType().Name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                _userRepository?.Dispose(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                _displayPreferencesRepository?.Dispose(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            _userRepository = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            _displayPreferencesRepository = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _disposed = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 |