Register IImageEncoder in Jellyfin.Server instead of Emby.Server.Implementations

This commit is contained in:
Mark Monteiro
2020-04-05 10:03:53 -04:00
parent 735d6c8ad5
commit f2760cb055
3 changed files with 15 additions and 8 deletions

View File

@@ -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();