The Free Software Media System - Server Backend & API
Construct LiveTvDtoService and LiveTvManager correctly
Mark Monteirocb2d99e8318d
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.csindex f437390c0e..e10627ad11 100644--- a/Emby.Server.Implementations/ApplicationHost.cs+++ b/Emby.Server.Implementations/ApplicationHost.cs@@ -779,6 +779,7 @@ namespace Emby.Server.ImplementationsserviceCollection.AddSingleton<IPlaylistManager, PlaylistManager>();+ serviceCollection.AddSingleton<LiveTvDtoService>();serviceCollection.AddSingleton<ILiveTvManager, LiveTvManager>();serviceCollection.AddSingleton<IUserViewManager, UserViewManager>();diff --git a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.csindex 6e903a18ef..55300c9671 100644--- a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs+++ b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs@@ -24,7 +24,6 @@ namespace Emby.Server.Implementations.LiveTv{private readonly ILogger _logger;private readonly IImageProcessor _imageProcessor;-private readonly IDtoService _dtoService;private readonly IApplicationHost _appHost;private readonly ILibraryManager _libraryManager;@@ -32,13 +31,13 @@ namespace Emby.Server.Implementations.LiveTvpublic LiveTvDtoService(IDtoService dtoService,IImageProcessor imageProcessor,- ILoggerFactory loggerFactory,+ ILogger<LiveTvDtoService> logger,IApplicationHost appHost,ILibraryManager libraryManager){_dtoService = dtoService;_imageProcessor = imageProcessor;- _logger = loggerFactory.CreateLogger(nameof(LiveTvDtoService));+ _logger = logger;_appHost = appHost;_libraryManager = libraryManager;}diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.csindex eabc207867..d8ff8a72fa 100644--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs@@ -45,29 +45,24 @@ namespace Emby.Server.Implementations.LiveTvprivate readonly ILogger _logger;private readonly IItemRepository _itemRepo;private readonly IUserManager _userManager;+ private readonly IDtoService _dtoService;private readonly IUserDataManager _userDataManager;private readonly ILibraryManager _libraryManager;private readonly ITaskManager _taskManager;+ private readonly ILocalizationManager _localization;private readonly IJsonSerializer _jsonSerializer;+ private readonly IFileSystem _fileSystem;private readonly IChannelManager _channelManager;-- private readonly IDtoService _dtoService;- private readonly ILocalizationManager _localization;-private readonly LiveTvDtoService _tvDtoService;private ILiveTvService[] _services = Array.Empty<ILiveTvService>();-private ITunerHost[] _tunerHosts = Array.Empty<ITunerHost>();private IListingsProvider[] _listingProviders = Array.Empty<IListingsProvider>();- private readonly IFileSystem _fileSystem;public LiveTvManager(- IServerApplicationHost appHost,IServerConfigurationManager config,- ILoggerFactory loggerFactory,+ ILogger<LiveTvManager> logger,IItemRepository itemRepo,- IImageProcessor imageProcessor,IUserDataManager userDataManager,IDtoService dtoService,IUserManager userManager,@@ -76,10 +71,11 @@ namespace Emby.Server.Implementations.LiveTvILocalizationManager localization,IJsonSerializer jsonSerializer,IFileSystem fileSystem,- IChannelManager channelManager)+ IChannelManager channelManager,+ LiveTvDtoService liveTvDtoService){_config = config;- _logger = loggerFactory.CreateLogger(nameof(LiveTvManager));+ _logger = logger;_itemRepo = itemRepo;_userManager = userManager;_libraryManager = libraryManager;@@ -90,8 +86,7 @@ namespace Emby.Server.Implementations.LiveTv_dtoService = dtoService;_userDataManager = userDataManager;_channelManager = channelManager;-- _tvDtoService = new LiveTvDtoService(dtoService, imageProcessor, loggerFactory, appHost, _libraryManager);+ _tvDtoService = liveTvDtoService;}public event EventHandler<GenericEventArgs<TimerEventInfo>> SeriesTimerCancelled;