aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/LiveTv
diff options
context:
space:
mode:
authorWilliam Taylor <me@willtaylor.info>2019-01-17 22:55:05 +0000
committerWilliam Taylor <me@willtaylor.info>2019-01-20 21:05:12 +0000
commit65cd3ed597c60503a517c06ad16c933ebf2434a9 (patch)
tree772d1d8d1b77a2363500dde7cf5a4d572fdf968f /Emby.Server.Implementations/LiveTv
parent0586598d33ea5eeed36259fe970a7e3184f6b087 (diff)
Replaced injections of ILogger with ILoggerFactory
This makes resolving dependencies from the container much easier as you cannot resolve with primitives parameters in a way that is any more readable. The aim of this commit is to change as little as possible with the end result, loggers that were newed up for the parent object were given the same name. Objects that used the base or app loggers, were given a new logger with an appropriate name. Also removed some unused dependencies.
Diffstat (limited to 'Emby.Server.Implementations/LiveTv')
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs9
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvManager.cs12
2 files changed, 10 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs
index d0cde06431..724e8afdf8 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs
@@ -26,11 +26,16 @@ namespace Emby.Server.Implementations.LiveTv
private readonly IApplicationHost _appHost;
private readonly ILibraryManager _libraryManager;
- public LiveTvDtoService(IDtoService dtoService, IImageProcessor imageProcessor, ILogger logger, IApplicationHost appHost, ILibraryManager libraryManager)
+ public LiveTvDtoService(
+ IDtoService dtoService,
+ IImageProcessor imageProcessor,
+ ILoggerFactory loggerFactory,
+ IApplicationHost appHost,
+ ILibraryManager libraryManager)
{
_dtoService = dtoService;
_imageProcessor = imageProcessor;
- _logger = logger;
+ _logger = loggerFactory.CreateLogger(nameof(LiveTvDtoService));
_appHost = appHost;
_libraryManager = libraryManager;
}
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
index 11d7facbe3..575cb1c77c 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -72,14 +72,10 @@ namespace Emby.Server.Implementations.LiveTv
return EmbyTV.EmbyTV.Current.GetActiveRecordingPath(id);
}
- private IServerApplicationHost _appHost;
- private IHttpClient _httpClient;
-
public LiveTvManager(
IServerApplicationHost appHost,
- IHttpClient httpClient,
IServerConfigurationManager config,
- ILogger logger,
+ ILoggerFactory loggerFactory,
IItemRepository itemRepo,
IImageProcessor imageProcessor,
IUserDataManager userDataManager,
@@ -93,9 +89,8 @@ namespace Emby.Server.Implementations.LiveTv
IFileSystem fileSystem,
Func<IChannelManager> channelManager)
{
- _appHost = appHost;
_config = config;
- _logger = logger;
+ _logger = loggerFactory.CreateLogger(nameof(LiveTvManager));
_itemRepo = itemRepo;
_userManager = userManager;
_libraryManager = libraryManager;
@@ -107,9 +102,8 @@ namespace Emby.Server.Implementations.LiveTv
_dtoService = dtoService;
_userDataManager = userDataManager;
_channelManager = channelManager;
- _httpClient = httpClient;
- _tvDtoService = new LiveTvDtoService(dtoService, imageProcessor, logger, appHost, _libraryManager);
+ _tvDtoService = new LiveTvDtoService(dtoService, imageProcessor, loggerFactory, appHost, _libraryManager);
}
/// <summary>