|
|
@ -245,8 +245,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;
|
|
|
|
|
|
|
|
|
|
|
|
public LocalizationManager LocalizationManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the installation manager.
|
|
|
|
/// Gets the installation manager.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -629,9 +627,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
|
|
|
|
|
|
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, BdInfoExaminer>();
|
|
|
|
serviceCollection.AddSingleton<IBlurayExaminer, BdInfoExaminer>();
|
|
|
|
|
|
|
|
|
|
|
@ -651,14 +647,15 @@ namespace Emby.Server.Implementations
|
|
|
|
serviceCollection.AddSingleton<IUserManager, UserManager>();
|
|
|
|
serviceCollection.AddSingleton<IUserManager, UserManager>();
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Add StartupOptions.FFmpegPath to IConfiguration so this doesn't need to be constructed manually
|
|
|
|
// TODO: Add StartupOptions.FFmpegPath to IConfiguration so this doesn't need to be constructed manually
|
|
|
|
serviceCollection.AddSingleton<IMediaEncoder>(new MediaBrowser.MediaEncoding.Encoder.MediaEncoder(
|
|
|
|
serviceCollection.AddSingleton<IMediaEncoder>(provider =>
|
|
|
|
LoggerFactory.CreateLogger<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>(),
|
|
|
|
new MediaBrowser.MediaEncoding.Encoder.MediaEncoder(
|
|
|
|
ServerConfigurationManager,
|
|
|
|
provider.GetRequiredService<ILogger<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>>(),
|
|
|
|
FileSystemManager,
|
|
|
|
provider.GetRequiredService<IServerConfigurationManager>(),
|
|
|
|
ProcessFactory,
|
|
|
|
provider.GetRequiredService<IFileSystem>(),
|
|
|
|
LocalizationManager,
|
|
|
|
provider.GetRequiredService<IProcessFactory>(),
|
|
|
|
Resolve<ISubtitleEncoder>,
|
|
|
|
provider.GetRequiredService<ILocalizationManager>(),
|
|
|
|
startupConfig,
|
|
|
|
provider.GetRequiredService<ISubtitleEncoder>,
|
|
|
|
|
|
|
|
provider.GetRequiredService<IConfiguration>(),
|
|
|
|
StartupOptions.FFmpegPath));
|
|
|
|
StartupOptions.FFmpegPath));
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Refactor to eliminate the circular dependencies here so that Lazy<T> isn't required
|
|
|
|
// TODO: Refactor to eliminate the circular dependencies here so that Lazy<T> isn't required
|
|
|
@ -735,8 +732,12 @@ namespace Emby.Server.Implementations
|
|
|
|
/// <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()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var localizationManager = (LocalizationManager)Resolve<ILocalizationManager>();
|
|
|
|
|
|
|
|
await localizationManager.LoadAll().ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
|
|
_mediaEncoder = Resolve<IMediaEncoder>();
|
|
|
|
_mediaEncoder = Resolve<IMediaEncoder>();
|
|
|
|
_sessionManager = Resolve<ISessionManager>();
|
|
|
|
_sessionManager = Resolve<ISessionManager>();
|
|
|
|
_httpServer = Resolve<IHttpServer>();
|
|
|
|
_httpServer = Resolve<IHttpServer>();
|
|
|
@ -833,7 +834,7 @@ namespace Emby.Server.Implementations
|
|
|
|
BaseItem.ConfigurationManager = ServerConfigurationManager;
|
|
|
|
BaseItem.ConfigurationManager = ServerConfigurationManager;
|
|
|
|
BaseItem.LibraryManager = Resolve<ILibraryManager>();
|
|
|
|
BaseItem.LibraryManager = Resolve<ILibraryManager>();
|
|
|
|
BaseItem.ProviderManager = Resolve<IProviderManager>();
|
|
|
|
BaseItem.ProviderManager = Resolve<IProviderManager>();
|
|
|
|
BaseItem.LocalizationManager = LocalizationManager;
|
|
|
|
BaseItem.LocalizationManager = Resolve<ILocalizationManager>();
|
|
|
|
BaseItem.ItemRepository = Resolve<IItemRepository>();
|
|
|
|
BaseItem.ItemRepository = Resolve<IItemRepository>();
|
|
|
|
User.UserManager = Resolve<IUserManager>();
|
|
|
|
User.UserManager = Resolve<IUserManager>();
|
|
|
|
BaseItem.FileSystem = FileSystemManager;
|
|
|
|
BaseItem.FileSystem = FileSystemManager;
|
|
|
|