diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-04-22 20:39:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-22 20:39:03 +0200 |
| commit | 07c4dfd8fe7331b80389ae5002397ae134b14f9e (patch) | |
| tree | 3730a47d01e54416fa4461a6e28eebaef4c8f7d2 /Emby.Server.Implementations/Data/SqliteItemRepository.cs | |
| parent | a85b1dcba663fe3bbb2441380cd8da382c92f2bd (diff) | |
| parent | 8f02fb9a4f062e2b6d980b6645a85e2681298dfa (diff) | |
Merge pull request #2765 from mark-monteiro/register-services-correctly
Register And Construct Services Correctly Using DI Framework
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteItemRepository.cs')
| -rw-r--r-- | Emby.Server.Implementations/Data/SqliteItemRepository.cs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 33ff74bb5..80889879f 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -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. GetImageCacheTag() is the only method used and it can be converted to a static helper method + 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); } } |
