diff options
| author | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-05 10:03:53 -0400 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-05 10:03:53 -0400 |
| commit | f2760cb055ae6ee5971ca4a3ff342ecd7d829d99 (patch) | |
| tree | 745068e3d39fcc1ae473c2f31f574bf899ca1d5c /Jellyfin.Server | |
| parent | 735d6c8ad531904c24650d88dd07ef3e57ded46a (diff) | |
Register IImageEncoder in Jellyfin.Server instead of Emby.Server.Implementations
Diffstat (limited to 'Jellyfin.Server')
| -rw-r--r-- | Jellyfin.Server/CoreAppHost.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Jellyfin.Server/CoreAppHost.cs b/Jellyfin.Server/CoreAppHost.cs index c3ac2ab411..0769bf844e 100644 --- a/Jellyfin.Server/CoreAppHost.cs +++ b/Jellyfin.Server/CoreAppHost.cs @@ -1,9 +1,12 @@ using System.Collections.Generic; using System.Reflection; +using Emby.Drawing; using Emby.Server.Implementations; +using Jellyfin.Drawing.Skia; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Drawing; using MediaBrowser.Model.IO; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; namespace Jellyfin.Server @@ -36,6 +39,17 @@ namespace Jellyfin.Server { } + /// <inheritdoc/> + protected override void RegisterServices(IServiceCollection serviceCollection) + { + var imageEncoderType = SkiaEncoder.IsNativeLibAvailable() + ? typeof(SkiaEncoder) + : typeof(NullImageEncoder); + serviceCollection.AddSingleton(typeof(IImageEncoder), imageEncoderType); + + base.RegisterServices(serviceCollection); + } + /// <inheritdoc /> protected override void RestartInternal() => Program.Restart(); |
