mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-05 05:42:52 +01:00
Register IImageEncoder in Jellyfin.Server instead of Emby.Server.Implementations
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user