diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-04-22 20:39:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-22 20:39:03 +0200 |
| commit | 07c4dfd8fe7331b80389ae5002397ae134b14f9e (patch) | |
| tree | 3730a47d01e54416fa4461a6e28eebaef4c8f7d2 /Jellyfin.Server/Program.cs | |
| parent | a85b1dcba663fe3bbb2441380cd8da382c92f2bd (diff) | |
| parent | 8f02fb9a4f062e2b6d980b6645a85e2681298dfa (diff) | |
Merge pull request #2765 from mark-monteiro/register-services-correctly
Register And Construct Services Correctly Using DI Framework
Diffstat (limited to 'Jellyfin.Server/Program.cs')
| -rw-r--r-- | Jellyfin.Server/Program.cs | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index e55b0d4ed..193d30e3a 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -184,7 +184,6 @@ namespace Jellyfin.Server _loggerFactory, options, new ManagedFileSystem(_loggerFactory.CreateLogger<ManagedFileSystem>(), appPaths), - GetImageEncoder(appPaths), new NetworkManager(_loggerFactory.CreateLogger<NetworkManager>())); try @@ -204,14 +203,13 @@ namespace Jellyfin.Server } ServiceCollection serviceCollection = new ServiceCollection(); - await appHost.InitAsync(serviceCollection, startupConfig).ConfigureAwait(false); + appHost.Init(serviceCollection); var webHost = CreateWebHostBuilder(appHost, serviceCollection, options, startupConfig, appPaths).Build(); // Re-use the web host service provider in the app host since ASP.NET doesn't allow a custom service collection. appHost.ServiceProvider = webHost.Services; - appHost.InitializeServices(); - appHost.FindParts(); + await appHost.InitializeServices().ConfigureAwait(false); Migrations.MigrationRunner.Run(appHost, _loggerFactory); try @@ -571,25 +569,6 @@ namespace Jellyfin.Server } } - private static IImageEncoder GetImageEncoder(IApplicationPaths appPaths) - { - try - { - // Test if the native lib is available - SkiaEncoder.TestSkia(); - - return new SkiaEncoder( - _loggerFactory.CreateLogger<SkiaEncoder>(), - appPaths); - } - catch (Exception ex) - { - _logger.LogWarning(ex, $"Skia not available. Will fallback to {nameof(NullImageEncoder)}."); - } - - return new NullImageEncoder(); - } - private static void StartNewInstance(StartupOptions options) { _logger.LogInformation("Starting new instance"); |
