mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 22:43:07 +03:00
Register and construct IImageProcessor, SqliteItemRepository and IImageEncoder correctly
This commit is contained in:
@@ -39,12 +39,11 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
private const string ChaptersTableName = "Chapters2";
|
||||
|
||||
/// <summary>
|
||||
/// The _app paths
|
||||
/// </summary>
|
||||
private readonly IServerConfigurationManager _config;
|
||||
private readonly IServerApplicationHost _appHost;
|
||||
private readonly ILocalizationManager _localization;
|
||||
// TODO: Remove this dependency
|
||||
private readonly IImageProcessor _imageProcessor;
|
||||
|
||||
private readonly TypeMapper _typeMapper;
|
||||
private readonly JsonSerializerOptions _jsonOptions;
|
||||
@@ -71,7 +70,8 @@ namespace Emby.Server.Implementations.Data
|
||||
IServerConfigurationManager config,
|
||||
IServerApplicationHost appHost,
|
||||
ILogger<SqliteItemRepository> logger,
|
||||
ILocalizationManager localization)
|
||||
ILocalizationManager localization,
|
||||
IImageProcessor imageProcessor)
|
||||
: base(logger)
|
||||
{
|
||||
if (config == null)
|
||||
@@ -82,6 +82,7 @@ namespace Emby.Server.Implementations.Data
|
||||
_config = config;
|
||||
_appHost = appHost;
|
||||
_localization = localization;
|
||||
_imageProcessor = imageProcessor;
|
||||
|
||||
_typeMapper = new TypeMapper();
|
||||
_jsonOptions = JsonDefaults.GetOptions();
|
||||
@@ -98,8 +99,6 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <inheritdoc />
|
||||
protected override TempStoreMode TempStore => TempStoreMode.Memory;
|
||||
|
||||
public IImageProcessor ImageProcessor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Opens the connection to the database
|
||||
/// </summary>
|
||||
@@ -1991,7 +1990,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
if (!string.IsNullOrEmpty(chapter.ImagePath))
|
||||
{
|
||||
chapter.ImageTag = ImageProcessor.GetImageCacheTag(item, chapter);
|
||||
chapter.ImageTag = _imageProcessor.GetImageCacheTag(item, chapter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user