mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-03 21:02:52 +01:00
Register and construct IImageProcessor, SqliteItemRepository and IImageEncoder correctly
This commit is contained in:
@@ -20,21 +20,18 @@ namespace Jellyfin.Server
|
||||
/// <param name="loggerFactory">The <see cref="ILoggerFactory" /> to be used by the <see cref="CoreAppHost" />.</param>
|
||||
/// <param name="options">The <see cref="StartupOptions" /> to be used by the <see cref="CoreAppHost" />.</param>
|
||||
/// <param name="fileSystem">The <see cref="IFileSystem" /> to be used by the <see cref="CoreAppHost" />.</param>
|
||||
/// <param name="imageEncoder">The <see cref="IImageEncoder" /> to be used by the <see cref="CoreAppHost" />.</param>
|
||||
/// <param name="networkManager">The <see cref="INetworkManager" /> to be used by the <see cref="CoreAppHost" />.</param>
|
||||
public CoreAppHost(
|
||||
ServerApplicationPaths applicationPaths,
|
||||
ILoggerFactory loggerFactory,
|
||||
StartupOptions options,
|
||||
IFileSystem fileSystem,
|
||||
IImageEncoder imageEncoder,
|
||||
INetworkManager networkManager)
|
||||
: base(
|
||||
applicationPaths,
|
||||
loggerFactory,
|
||||
options,
|
||||
fileSystem,
|
||||
imageEncoder,
|
||||
networkManager)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -183,7 +183,6 @@ namespace Jellyfin.Server
|
||||
_loggerFactory,
|
||||
options,
|
||||
new ManagedFileSystem(_loggerFactory.CreateLogger<ManagedFileSystem>(), appPaths),
|
||||
GetImageEncoder(appPaths),
|
||||
new NetworkManager(_loggerFactory.CreateLogger<NetworkManager>()));
|
||||
|
||||
try
|
||||
@@ -553,25 +552,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");
|
||||
|
||||
Reference in New Issue
Block a user