From a6a4cd5667fbb5a793cb9e551ce9c9a9bfb0d44b Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Wed, 6 Feb 2019 20:38:42 +0100 Subject: [PATCH] Removed some unused fields --- BDInfo/BDROM.cs | 4 ++-- BDInfo/TSPlaylistFile.cs | 7 ++----- BDInfo/TSStreamClipFile.cs | 4 +--- .../IsoMounter/LinuxIsoManager.cs | 4 +--- Emby.Photos/PhotoProvider.cs | 5 +---- .../AppBase/BaseConfigurationManager.cs | 2 +- .../AppBase/ConfigurationHelper.cs | 4 +--- .../ApplicationHost.cs | 14 ++++++------- .../Archiving/ZipClient.cs | 6 ++---- .../Collections/CollectionImageProvider.cs | 8 +++++-- .../Collections/CollectionManager.cs | 4 +--- .../Data/CleanDatabaseScheduledTask.cs | 11 +--------- .../Devices/DeviceId.cs | 12 +---------- .../Devices/DeviceManager.cs | 12 ++--------- Emby.Server.Implementations/Dto/DtoService.cs | 12 ----------- .../FFMpeg/FFMpegLoader.cs | 13 ++---------- .../IO/FileRefresher.cs | 10 +-------- .../IO/LibraryMonitor.cs | 21 ++++--------------- .../Library/CoreResolutionIgnoreRule.cs | 14 ++++--------- .../Library/LibraryManager.cs | 4 ++-- .../Library/Resolvers/BaseVideoResolver.cs | 5 +---- .../Library/Resolvers/Movies/MovieResolver.cs | 3 ++- .../Library/Resolvers/PhotoResolver.cs | 8 ++----- .../Library/Resolvers/TV/EpisodeResolver.cs | 4 ++-- .../Library/Resolvers/VideoResolver.cs | 4 ++-- .../Library/UserManager.cs | 5 +---- .../Library/Validators/PeopleValidator.cs | 4 +--- .../LiveTv/EmbyTV/EmbyTV.cs | 6 +++--- .../LiveTv/EmbyTV/EncodedRecorder.cs | 15 ++++++------- .../LiveTv/EmbyTV/ItemDataProvider.cs | 4 +--- .../LiveTv/EmbyTV/SeriesTimerManager.cs | 5 ++--- .../LiveTv/EmbyTV/TimerManager.cs | 5 ++--- .../LiveTv/TunerHosts/BaseTunerHost.cs | 5 +---- .../TunerHosts/HdHomerun/HdHomerunHost.cs | 13 +++++++++--- .../LiveTv/TunerHosts/M3UTunerHost.cs | 9 ++++---- .../LiveTv/TunerHosts/M3uParser.cs | 4 +--- 36 files changed, 85 insertions(+), 185 deletions(-) diff --git a/BDInfo/BDROM.cs b/BDInfo/BDROM.cs index 4360ff1d42..6759ed55ad 100644 --- a/BDInfo/BDROM.cs +++ b/BDInfo/BDROM.cs @@ -165,7 +165,7 @@ namespace BDInfo foreach (var file in files) { PlaylistFiles.Add( - file.Name.ToUpper(), new TSPlaylistFile(this, file, _fileSystem)); + file.Name.ToUpper(), new TSPlaylistFile(this, file)); } } @@ -185,7 +185,7 @@ namespace BDInfo foreach (var file in files) { StreamClipFiles.Add( - file.Name.ToUpper(), new TSStreamClipFile(file, _fileSystem)); + file.Name.ToUpper(), new TSStreamClipFile(file)); } } diff --git a/BDInfo/TSPlaylistFile.cs b/BDInfo/TSPlaylistFile.cs index 6e91f6e408..1cc629b1de 100644 --- a/BDInfo/TSPlaylistFile.cs +++ b/BDInfo/TSPlaylistFile.cs @@ -28,7 +28,6 @@ namespace BDInfo { public class TSPlaylistFile { - private readonly IFileSystem _fileSystem; private FileSystemMetadata FileInfo = null; public string FileType = null; public bool IsInitialized = false; @@ -64,21 +63,19 @@ namespace BDInfo new List(); public TSPlaylistFile(BDROM bdrom, - FileSystemMetadata fileInfo, IFileSystem fileSystem) + FileSystemMetadata fileInfo) { BDROM = bdrom; FileInfo = fileInfo; - _fileSystem = fileSystem; Name = fileInfo.Name.ToUpper(); } public TSPlaylistFile(BDROM bdrom, string name, - List clips, IFileSystem fileSystem) + List clips) { BDROM = bdrom; Name = name; - _fileSystem = fileSystem; IsCustom = true; foreach (var clip in clips) { diff --git a/BDInfo/TSStreamClipFile.cs b/BDInfo/TSStreamClipFile.cs index d840542ba9..e1097b23da 100644 --- a/BDInfo/TSStreamClipFile.cs +++ b/BDInfo/TSStreamClipFile.cs @@ -28,7 +28,6 @@ namespace BDInfo { public class TSStreamClipFile { - private readonly IFileSystem _fileSystem; public FileSystemMetadata FileInfo = null; public string FileType = null; public bool IsValid = false; @@ -37,10 +36,9 @@ namespace BDInfo public Dictionary Streams = new Dictionary(); - public TSStreamClipFile(FileSystemMetadata fileInfo, IFileSystem fileSystem) + public TSStreamClipFile(FileSystemMetadata fileInfo) { FileInfo = fileInfo; - _fileSystem = fileSystem; Name = fileInfo.Name.ToUpper(); } diff --git a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs index a6fc53953e..943caa3e62 100644 --- a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs +++ b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs @@ -19,7 +19,6 @@ namespace IsoMounter private readonly IEnvironmentInfo EnvironmentInfo; private readonly bool ExecutablesAvailable; - private readonly IFileSystem FileSystem; private readonly ILogger _logger; private readonly string MountCommand; private readonly string MountPointRoot; @@ -31,11 +30,10 @@ namespace IsoMounter #region Constructor(s) - public LinuxIsoManager(ILogger logger, IFileSystem fileSystem, IEnvironmentInfo environment, IProcessFactory processFactory) + public LinuxIsoManager(ILogger logger, IEnvironmentInfo environment, IProcessFactory processFactory) { EnvironmentInfo = environment; - FileSystem = fileSystem; _logger = logger; ProcessFactory = processFactory; diff --git a/Emby.Photos/PhotoProvider.cs b/Emby.Photos/PhotoProvider.cs index f3457d1055..a4179e6609 100644 --- a/Emby.Photos/PhotoProvider.cs +++ b/Emby.Photos/PhotoProvider.cs @@ -9,7 +9,6 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.IO; using Microsoft.Extensions.Logging; using TagLib; using TagLib.IFD; @@ -21,13 +20,11 @@ namespace Emby.Photos public class PhotoProvider : ICustomMetadataProvider, IForcedProvider, IHasItemChangeMonitor { private readonly ILogger _logger; - private readonly IFileSystem _fileSystem; private IImageProcessor _imageProcessor; - public PhotoProvider(ILogger logger, IFileSystem fileSystem, IImageProcessor imageProcessor) + public PhotoProvider(ILogger logger, IImageProcessor imageProcessor) { _logger = logger; - _fileSystem = fileSystem; _imageProcessor = imageProcessor; } diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs index 460809e936..d7fa4d4c20 100644 --- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs +++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs @@ -79,7 +79,7 @@ namespace Emby.Server.Implementations.AppBase get { // Lazy load - LazyInitializer.EnsureInitialized(ref _configuration, ref _configurationLoaded, ref _configurationSyncLock, () => (BaseApplicationConfiguration)ConfigurationHelper.GetXmlConfiguration(ConfigurationType, CommonApplicationPaths.SystemConfigurationFilePath, XmlSerializer, FileSystem)); + LazyInitializer.EnsureInitialized(ref _configuration, ref _configurationLoaded, ref _configurationSyncLock, () => (BaseApplicationConfiguration)ConfigurationHelper.GetXmlConfiguration(ConfigurationType, CommonApplicationPaths.SystemConfigurationFilePath, XmlSerializer)); return _configuration; } protected set diff --git a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs index 3faad76e7d..90b97061f3 100644 --- a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs +++ b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.Linq; -using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; namespace Emby.Server.Implementations.AppBase @@ -18,9 +17,8 @@ namespace Emby.Server.Implementations.AppBase /// The type. /// The path. /// The XML serializer. - /// The file system /// System.Object. - public static object GetXmlConfiguration(Type type, string path, IXmlSerializer xmlSerializer, IFileSystem fileSystem) + public static object GetXmlConfiguration(Type type, string path, IXmlSerializer xmlSerializer) { object configuration; diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index bb475eb2c7..5c7133d058 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -440,7 +440,7 @@ namespace Emby.Server.Implementations { if (_deviceId == null) { - _deviceId = new DeviceId(ApplicationPaths, LoggerFactory, FileSystemManager); + _deviceId = new DeviceId(ApplicationPaths, LoggerFactory); } return _deviceId.Value; @@ -780,7 +780,7 @@ namespace Emby.Server.Implementations InstallationManager = new InstallationManager(LoggerFactory, this, ApplicationPaths, HttpClient, JsonSerializer, ServerConfigurationManager, FileSystemManager, CryptographyProvider, PackageRuntime); RegisterSingleInstance(InstallationManager); - ZipClient = new ZipClient(FileSystemManager); + ZipClient = new ZipClient(); RegisterSingleInstance(ZipClient); HttpResultFactory = new HttpResultFactory(LoggerFactory, FileSystemManager, JsonSerializer, CreateBrotliCompressor()); @@ -820,7 +820,7 @@ namespace Emby.Server.Implementations AuthenticationRepository = GetAuthenticationRepository(); RegisterSingleInstance(AuthenticationRepository); - UserManager = new UserManager(LoggerFactory, ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, this, JsonSerializer, FileSystemManager, CryptographyProvider); + UserManager = new UserManager(LoggerFactory, ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, this, JsonSerializer, FileSystemManager); RegisterSingleInstance(UserManager); LibraryManager = new LibraryManager(this, LoggerFactory, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => LibraryMonitor, FileSystemManager, () => ProviderManager, () => UserViewManager); @@ -830,7 +830,7 @@ namespace Emby.Server.Implementations var musicManager = new MusicManager(LibraryManager); RegisterSingleInstance(new MusicManager(LibraryManager)); - LibraryMonitor = new LibraryMonitor(LoggerFactory, TaskManager, LibraryManager, ServerConfigurationManager, FileSystemManager, EnvironmentInfo); + LibraryMonitor = new LibraryMonitor(LoggerFactory, LibraryManager, ServerConfigurationManager, FileSystemManager, EnvironmentInfo); RegisterSingleInstance(LibraryMonitor); RegisterSingleInstance(() => new SearchEngine(LoggerFactory, LibraryManager, UserManager)); @@ -859,7 +859,7 @@ namespace Emby.Server.Implementations var encryptionManager = new EncryptionManager(); RegisterSingleInstance(encryptionManager); - DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager, LoggerFactory, NetworkManager); + DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager); RegisterSingleInstance(DeviceManager); MediaSourceManager = new MediaSourceManager(ItemRepository, ApplicationPaths, LocalizationManager, UserManager, LibraryManager, LoggerFactory, JsonSerializer, FileSystemManager, UserDataManager, () => MediaEncoder); @@ -871,7 +871,7 @@ namespace Emby.Server.Implementations ProviderManager = new ProviderManager(HttpClient, SubtitleManager, ServerConfigurationManager, LibraryMonitor, LoggerFactory, FileSystemManager, ApplicationPaths, () => LibraryManager, JsonSerializer); RegisterSingleInstance(ProviderManager); - DtoService = new DtoService(LoggerFactory, LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, this, () => DeviceManager, () => MediaSourceManager, () => LiveTvManager); + DtoService = new DtoService(LoggerFactory, LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ProviderManager, this, () => MediaSourceManager, () => LiveTvManager); RegisterSingleInstance(DtoService); ChannelManager = new ChannelManager(UserManager, DtoService, LibraryManager, LoggerFactory, ServerConfigurationManager, FileSystemManager, UserDataManager, JsonSerializer, LocalizationManager, HttpClient, ProviderManager); @@ -1058,7 +1058,7 @@ namespace Emby.Server.Implementations protected virtual FFMpegInfo GetFFMpegInfo() { - return new FFMpegLoader(Logger, ApplicationPaths, HttpClient, ZipClient, FileSystemManager, GetFfmpegInstallInfo()) + return new FFMpegLoader(ApplicationPaths, FileSystemManager, GetFfmpegInstallInfo()) .GetFFMpegInfo(StartupOptions); } diff --git a/Emby.Server.Implementations/Archiving/ZipClient.cs b/Emby.Server.Implementations/Archiving/ZipClient.cs index 1135cf694d..6b0fd2dc6c 100644 --- a/Emby.Server.Implementations/Archiving/ZipClient.cs +++ b/Emby.Server.Implementations/Archiving/ZipClient.cs @@ -14,11 +14,9 @@ namespace Emby.Server.Implementations.Archiving /// public class ZipClient : IZipClient { - private readonly IFileSystem _fileSystem; - - public ZipClient(IFileSystem fileSystem) + public ZipClient() { - _fileSystem = fileSystem; + } /// diff --git a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs index 6aeadda2fb..cdfb5cadf1 100644 --- a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs +++ b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs @@ -10,14 +10,18 @@ using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Extensions; using MediaBrowser.Model.IO; namespace Emby.Server.Implementations.Collections { public class CollectionImageProvider : BaseDynamicImageProvider { - public CollectionImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor) : base(fileSystem, providerManager, applicationPaths, imageProcessor) + public CollectionImageProvider( + IFileSystem fileSystem, + IProviderManager providerManager, + IApplicationPaths applicationPaths, + IImageProcessor imageProcessor) + : base(fileSystem, providerManager, applicationPaths, imageProcessor) { } diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs index 812e48a1f8..2b99e0ddfc 100644 --- a/Emby.Server.Implementations/Collections/CollectionManager.cs +++ b/Emby.Server.Implementations/Collections/CollectionManager.cs @@ -342,14 +342,12 @@ namespace Emby.Server.Implementations.Collections { private readonly CollectionManager _collectionManager; private readonly IServerConfigurationManager _config; - private readonly IFileSystem _fileSystem; private ILogger _logger; - public CollectionManagerEntryPoint(ICollectionManager collectionManager, IServerConfigurationManager config, IFileSystem fileSystem, ILogger logger) + public CollectionManagerEntryPoint(ICollectionManager collectionManager, IServerConfigurationManager config, ILogger logger) { _collectionManager = (CollectionManager)collectionManager; _config = config; - _fileSystem = fileSystem; _logger = logger; } diff --git a/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs b/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs index dcfe149434..f7743a3c25 100644 --- a/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs +++ b/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs @@ -1,11 +1,8 @@ using System; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Common.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.Persistence; -using MediaBrowser.Model.IO; using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Data @@ -13,18 +10,12 @@ namespace Emby.Server.Implementations.Data public class CleanDatabaseScheduledTask : ILibraryPostScanTask { private readonly ILibraryManager _libraryManager; - private readonly IItemRepository _itemRepo; private readonly ILogger _logger; - private readonly IFileSystem _fileSystem; - private readonly IApplicationPaths _appPaths; - public CleanDatabaseScheduledTask(ILibraryManager libraryManager, IItemRepository itemRepo, ILogger logger, IFileSystem fileSystem, IApplicationPaths appPaths) + public CleanDatabaseScheduledTask(ILibraryManager libraryManager, ILogger logger) { _libraryManager = libraryManager; - _itemRepo = itemRepo; _logger = logger; - _fileSystem = fileSystem; - _appPaths = appPaths; } public Task Run(IProgress progress, CancellationToken cancellationToken) diff --git a/Emby.Server.Implementations/Devices/DeviceId.cs b/Emby.Server.Implementations/Devices/DeviceId.cs index 866bd137ff..495c3436ab 100644 --- a/Emby.Server.Implementations/Devices/DeviceId.cs +++ b/Emby.Server.Implementations/Devices/DeviceId.cs @@ -11,7 +11,6 @@ namespace Emby.Server.Implementations.Devices { private readonly IApplicationPaths _appPaths; private readonly ILogger _logger; - private readonly IFileSystem _fileSystem; private readonly object _syncLock = new object(); @@ -86,19 +85,10 @@ namespace Emby.Server.Implementations.Devices private string _id; - public DeviceId( - IApplicationPaths appPaths, - ILoggerFactory loggerFactory, - IFileSystem fileSystem) + public DeviceId(IApplicationPaths appPaths, ILoggerFactory loggerFactory) { - if (fileSystem == null) - { - throw new ArgumentNullException(nameof(fileSystem)); - } - _appPaths = appPaths; _logger = loggerFactory.CreateLogger("SystemId"); - _fileSystem = fileSystem; } public string Value => _id ?? (_id = GetDeviceId()); diff --git a/Emby.Server.Implementations/Devices/DeviceManager.cs b/Emby.Server.Implementations/Devices/DeviceManager.cs index ec3649bcac..7d6529a675 100644 --- a/Emby.Server.Implementations/Devices/DeviceManager.cs +++ b/Emby.Server.Implementations/Devices/DeviceManager.cs @@ -34,8 +34,6 @@ namespace Emby.Server.Implementations.Devices private readonly IFileSystem _fileSystem; private readonly ILibraryMonitor _libraryMonitor; private readonly IServerConfigurationManager _config; - private readonly ILogger _logger; - private readonly INetworkManager _network; private readonly ILibraryManager _libraryManager; private readonly ILocalizationManager _localizationManager; @@ -55,17 +53,13 @@ namespace Emby.Server.Implementations.Devices IUserManager userManager, IFileSystem fileSystem, ILibraryMonitor libraryMonitor, - IServerConfigurationManager config, - ILoggerFactory loggerFactory, - INetworkManager network) + IServerConfigurationManager config) { _json = json; _userManager = userManager; _fileSystem = fileSystem; _libraryMonitor = libraryMonitor; _config = config; - _logger = loggerFactory.CreateLogger(nameof(DeviceManager)); - _network = network; _libraryManager = libraryManager; _localizationManager = localizationManager; _authRepo = authRepo; @@ -414,14 +408,12 @@ namespace Emby.Server.Implementations.Devices { private readonly DeviceManager _deviceManager; private readonly IServerConfigurationManager _config; - private readonly IFileSystem _fileSystem; private ILogger _logger; - public DeviceManagerEntryPoint(IDeviceManager deviceManager, IServerConfigurationManager config, IFileSystem fileSystem, ILogger logger) + public DeviceManagerEntryPoint(IDeviceManager deviceManager, IServerConfigurationManager config, ILogger logger) { _deviceManager = (DeviceManager)deviceManager; _config = config; - _fileSystem = fileSystem; _logger = logger; } diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 983eb51e63..2233d3d40c 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -36,13 +36,9 @@ namespace Emby.Server.Implementations.Dto private readonly IItemRepository _itemRepo; private readonly IImageProcessor _imageProcessor; - private readonly IServerConfigurationManager _config; - private readonly IFileSystem _fileSystem; private readonly IProviderManager _providerManager; - private readonly Func _channelManagerFactory; private readonly IApplicationHost _appHost; - private readonly Func _deviceManager; private readonly Func _mediaSourceManager; private readonly Func _livetvManager; @@ -52,12 +48,8 @@ namespace Emby.Server.Implementations.Dto IUserDataManager userDataRepository, IItemRepository itemRepo, IImageProcessor imageProcessor, - IServerConfigurationManager config, - IFileSystem fileSystem, IProviderManager providerManager, - Func channelManagerFactory, IApplicationHost appHost, - Func deviceManager, Func mediaSourceManager, Func livetvManager) { @@ -66,12 +58,8 @@ namespace Emby.Server.Implementations.Dto _userDataRepository = userDataRepository; _itemRepo = itemRepo; _imageProcessor = imageProcessor; - _config = config; - _fileSystem = fileSystem; _providerManager = providerManager; - _channelManagerFactory = channelManagerFactory; _appHost = appHost; - _deviceManager = deviceManager; _mediaSourceManager = mediaSourceManager; _livetvManager = livetvManager; } diff --git a/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs b/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs index 6167d1eaa4..bbf51dd246 100644 --- a/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs +++ b/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs @@ -3,27 +3,19 @@ using System.Collections.Generic; using System.IO; using System.Linq; using MediaBrowser.Common.Configuration; -using MediaBrowser.Common.Net; using MediaBrowser.Model.IO; -using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.FFMpeg { public class FFMpegLoader { - private readonly IHttpClient _httpClient; private readonly IApplicationPaths _appPaths; - private readonly ILogger _logger; - private readonly IZipClient _zipClient; private readonly IFileSystem _fileSystem; private readonly FFMpegInstallInfo _ffmpegInstallInfo; - public FFMpegLoader(ILogger logger, IApplicationPaths appPaths, IHttpClient httpClient, IZipClient zipClient, IFileSystem fileSystem, FFMpegInstallInfo ffmpegInstallInfo) + public FFMpegLoader(IApplicationPaths appPaths, IFileSystem fileSystem, FFMpegInstallInfo ffmpegInstallInfo) { - _logger = logger; _appPaths = appPaths; - _httpClient = httpClient; - _zipClient = zipClient; _fileSystem = fileSystem; _ffmpegInstallInfo = ffmpegInstallInfo; } @@ -115,8 +107,7 @@ namespace Emby.Server.Implementations.FFMpeg var encoderFilename = Path.GetFileName(info.EncoderPath); var probeFilename = Path.GetFileName(info.ProbePath); - foreach (var directory in _fileSystem.GetDirectoryPaths(rootEncoderPath) - .ToList()) + foreach (var directory in _fileSystem.GetDirectoryPaths(rootEncoderPath)) { var allFiles = _fileSystem.GetFilePaths(directory, true).ToList(); diff --git a/Emby.Server.Implementations/IO/FileRefresher.cs b/Emby.Server.Implementations/IO/FileRefresher.cs index 3668f6a7ab..73242d0ade 100644 --- a/Emby.Server.Implementations/IO/FileRefresher.cs +++ b/Emby.Server.Implementations/IO/FileRefresher.cs @@ -17,31 +17,23 @@ namespace Emby.Server.Implementations.IO public class FileRefresher : IDisposable { private ILogger Logger { get; set; } - private ITaskManager TaskManager { get; set; } private ILibraryManager LibraryManager { get; set; } private IServerConfigurationManager ConfigurationManager { get; set; } - private readonly IFileSystem _fileSystem; private readonly List _affectedPaths = new List(); private Timer _timer; private readonly object _timerLock = new object(); public string Path { get; private set; } public event EventHandler Completed; - private readonly IEnvironmentInfo _environmentInfo; - private readonly ILibraryManager _libraryManager; - public FileRefresher(string path, IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, ITaskManager taskManager, ILogger logger, IEnvironmentInfo environmentInfo, ILibraryManager libraryManager1) + public FileRefresher(string path, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, ILogger logger) { logger.LogDebug("New file refresher created for {0}", path); Path = path; - _fileSystem = fileSystem; ConfigurationManager = configurationManager; LibraryManager = libraryManager; - TaskManager = taskManager; Logger = logger; - _environmentInfo = environmentInfo; - _libraryManager = libraryManager1; AddPath(path); } diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs index 607a4d333f..d473425115 100644 --- a/Emby.Server.Implementations/IO/LibraryMonitor.cs +++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs @@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.IO /// /// Any file name ending in any of these will be ignored by the watchers /// - private readonly HashSet _alwaysIgnoreFiles = new HashSet(StringComparer.OrdinalIgnoreCase) + private static readonly HashSet _alwaysIgnoreFiles = new HashSet(StringComparer.OrdinalIgnoreCase) { "small.jpg", "albumart.jpg", @@ -44,7 +44,7 @@ namespace Emby.Server.Implementations.IO "TempSBE" }; - private readonly string[] _alwaysIgnoreSubstrings = new string[] + private static readonly string[] _alwaysIgnoreSubstrings = new string[] { // Synology "eaDir", @@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.IO ".actors" }; - private readonly HashSet _alwaysIgnoreExtensions = new HashSet(StringComparer.OrdinalIgnoreCase) + private static readonly HashSet _alwaysIgnoreExtensions = new HashSet(StringComparer.OrdinalIgnoreCase) { // thumbs.db ".db", @@ -123,12 +123,6 @@ namespace Emby.Server.Implementations.IO /// The logger. private ILogger Logger { get; set; } - /// - /// Gets or sets the task manager. - /// - /// The task manager. - private ITaskManager TaskManager { get; set; } - private ILibraryManager LibraryManager { get; set; } private IServerConfigurationManager ConfigurationManager { get; set; } @@ -140,19 +134,12 @@ namespace Emby.Server.Implementations.IO /// public LibraryMonitor( ILoggerFactory loggerFactory, - ITaskManager taskManager, ILibraryManager libraryManager, IServerConfigurationManager configurationManager, IFileSystem fileSystem, IEnvironmentInfo environmentInfo) { - if (taskManager == null) - { - throw new ArgumentNullException(nameof(taskManager)); - } - LibraryManager = libraryManager; - TaskManager = taskManager; Logger = loggerFactory.CreateLogger(GetType().Name); ConfigurationManager = configurationManager; _fileSystem = fileSystem; @@ -541,7 +528,7 @@ namespace Emby.Server.Implementations.IO } } - var newRefresher = new FileRefresher(path, _fileSystem, ConfigurationManager, LibraryManager, TaskManager, Logger, _environmentInfo, LibraryManager); + var newRefresher = new FileRefresher(path, ConfigurationManager, LibraryManager, Logger); newRefresher.Completed += NewRefresher_Completed; _activeRefreshers.Add(newRefresher); } diff --git a/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs index 80f746c7a9..c644d13eab 100644 --- a/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs +++ b/Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Linq; using MediaBrowser.Controller.Entities; @@ -7,7 +6,6 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Resolvers; using MediaBrowser.Model.Extensions; using MediaBrowser.Model.IO; -using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Library { @@ -16,16 +14,14 @@ namespace Emby.Server.Implementations.Library /// public class CoreResolutionIgnoreRule : IResolverIgnoreRule { - private readonly IFileSystem _fileSystem; private readonly ILibraryManager _libraryManager; - private readonly ILogger _logger; private bool _ignoreDotPrefix; /// /// Any folder named in this list will be ignored - can be added to at runtime for extensibility /// - public static readonly Dictionary IgnoreFolders = new List + public static readonly string[] IgnoreFolders = { "metadata", "ps3_update", @@ -50,13 +46,11 @@ namespace Emby.Server.Implementations.Library // macos ".AppleDouble" - }.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase); + }; - public CoreResolutionIgnoreRule(IFileSystem fileSystem, ILibraryManager libraryManager, ILogger logger) + public CoreResolutionIgnoreRule(ILibraryManager libraryManager) { - _fileSystem = fileSystem; _libraryManager = libraryManager; - _logger = logger; _ignoreDotPrefix = Environment.OSVersion.Platform != PlatformID.Win32NT; } @@ -117,7 +111,7 @@ namespace Emby.Server.Implementations.Library if (fileInfo.IsDirectory) { // Ignore any folders in our list - if (IgnoreFolders.ContainsKey(filename)) + if (IgnoreFolders.Contains(filename, StringComparer.OrdinalIgnoreCase)) { return true; } diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 064006ebd6..87809cae86 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -986,7 +986,7 @@ namespace Emby.Server.Implementations.Library // Ensure the location is available. Directory.CreateDirectory(ConfigurationManager.ApplicationPaths.PeoplePath); - return new PeopleValidator(this, _logger, ConfigurationManager, _fileSystem).ValidatePeople(cancellationToken, progress); + return new PeopleValidator(this, _logger, _fileSystem).ValidatePeople(cancellationToken, progress); } /// @@ -2543,7 +2543,7 @@ namespace Emby.Server.Implementations.Library var resolvers = new IItemResolver[] { - new GenericVideoResolver(this, _fileSystem) + new GenericVideoResolver(this) }; return ResolvePaths(files, directoryService, null, new LibraryOptions(), null, resolvers) diff --git a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs index d992f8d030..541b13cbe1 100644 --- a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs @@ -6,7 +6,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.IO; namespace Emby.Server.Implementations.Library.Resolvers { @@ -18,11 +17,9 @@ namespace Emby.Server.Implementations.Library.Resolvers where T : Video, new() { protected readonly ILibraryManager LibraryManager; - protected readonly IFileSystem FileSystem; - protected BaseVideoResolver(ILibraryManager libraryManager, IFileSystem fileSystem) + protected BaseVideoResolver(ILibraryManager libraryManager) { - FileSystem = fileSystem; LibraryManager = libraryManager; } diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 472a3f105c..8485636794 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -548,7 +548,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies private IImageProcessor _imageProcessor; - public MovieResolver(ILibraryManager libraryManager, IFileSystem fileSystem, IImageProcessor imageProcessor) : base(libraryManager, fileSystem) + public MovieResolver(ILibraryManager libraryManager, IImageProcessor imageProcessor) + : base(libraryManager) { _imageProcessor = imageProcessor; } diff --git a/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs index a3298c5803..db270c398b 100644 --- a/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs @@ -7,7 +7,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.IO; namespace Emby.Server.Implementations.Library.Resolvers { @@ -15,13 +14,11 @@ namespace Emby.Server.Implementations.Library.Resolvers { private readonly IImageProcessor _imageProcessor; private readonly ILibraryManager _libraryManager; - private readonly IFileSystem _fileSystem; - public PhotoResolver(IImageProcessor imageProcessor, ILibraryManager libraryManager, IFileSystem fileSystem) + public PhotoResolver(IImageProcessor imageProcessor, ILibraryManager libraryManager) { _imageProcessor = imageProcessor; _libraryManager = libraryManager; - _fileSystem = fileSystem; } /// @@ -113,8 +110,7 @@ namespace Emby.Server.Implementations.Library.Resolvers return false; } - return imageProcessor.SupportedInputFormats.Contains((Path.GetExtension(path) ?? string.Empty).TrimStart('.')); + return imageProcessor.SupportedInputFormats.Contains(Path.GetExtension(path).TrimStart('.'), StringComparer.Ordinal); } - } } diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs index fed0904d19..a6d18c9b5a 100644 --- a/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs @@ -3,7 +3,6 @@ using System.Linq; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.IO; namespace Emby.Server.Implementations.Library.Resolvers.TV { @@ -74,7 +73,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV return null; } - public EpisodeResolver(ILibraryManager libraryManager, IFileSystem fileSystem) : base(libraryManager, fileSystem) + public EpisodeResolver(ILibraryManager libraryManager) + : base(libraryManager) { } } diff --git a/Emby.Server.Implementations/Library/Resolvers/VideoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/VideoResolver.cs index 60752a85db..68d5d8b2de 100644 --- a/Emby.Server.Implementations/Library/Resolvers/VideoResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/VideoResolver.cs @@ -1,13 +1,13 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; -using MediaBrowser.Model.IO; namespace Emby.Server.Implementations.Library.Resolvers { public class GenericVideoResolver : BaseVideoResolver where T : Video, new() { - public GenericVideoResolver(ILibraryManager libraryManager, IFileSystem fileSystem) : base(libraryManager, fileSystem) + public GenericVideoResolver(ILibraryManager libraryManager) + : base(libraryManager) { } } diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs index 3ff84382f2..15cbbdb5ae 100644 --- a/Emby.Server.Implementations/Library/UserManager.cs +++ b/Emby.Server.Implementations/Library/UserManager.cs @@ -74,7 +74,6 @@ namespace Emby.Server.Implementations.Library private readonly Func _dtoServiceFactory; private readonly IServerApplicationHost _appHost; private readonly IFileSystem _fileSystem; - private readonly ICryptoProvider _cryptographyProvider; private IAuthenticationProvider[] _authenticationProviders; private DefaultAuthenticationProvider _defaultAuthenticationProvider; @@ -89,8 +88,7 @@ namespace Emby.Server.Implementations.Library Func dtoServiceFactory, IServerApplicationHost appHost, IJsonSerializer jsonSerializer, - IFileSystem fileSystem, - ICryptoProvider cryptographyProvider) + IFileSystem fileSystem) { _logger = loggerFactory.CreateLogger(nameof(UserManager)); UserRepository = userRepository; @@ -101,7 +99,6 @@ namespace Emby.Server.Implementations.Library _appHost = appHost; _jsonSerializer = jsonSerializer; _fileSystem = fileSystem; - _cryptographyProvider = cryptographyProvider; ConfigurationManager = configurationManager; _users = Array.Empty(); diff --git a/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs b/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs index 0ea543ba01..7899cf01b3 100644 --- a/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/PeopleValidator.cs @@ -24,7 +24,6 @@ namespace Emby.Server.Implementations.Library.Validators /// private readonly ILogger _logger; - private readonly IServerConfigurationManager _config; private readonly IFileSystem _fileSystem; /// @@ -32,11 +31,10 @@ namespace Emby.Server.Implementations.Library.Validators /// /// The library manager. /// The logger. - public PeopleValidator(ILibraryManager libraryManager, ILogger logger, IServerConfigurationManager config, IFileSystem fileSystem) + public PeopleValidator(ILibraryManager libraryManager, ILogger logger, IFileSystem fileSystem) { _libraryManager = libraryManager; _logger = logger; - _config = config; _fileSystem = fileSystem; } diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 84ca130b76..fceb82ba19 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -105,8 +105,8 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV _mediaSourceManager = mediaSourceManager; _streamHelper = streamHelper; - _seriesTimerProvider = new SeriesTimerManager(fileSystem, jsonSerializer, _logger, Path.Combine(DataPath, "seriestimers")); - _timerProvider = new TimerManager(fileSystem, jsonSerializer, _logger, Path.Combine(DataPath, "timers"), _logger); + _seriesTimerProvider = new SeriesTimerManager(jsonSerializer, _logger, Path.Combine(DataPath, "seriestimers")); + _timerProvider = new TimerManager(jsonSerializer, _logger, Path.Combine(DataPath, "timers"), _logger); _timerProvider.TimerFired += _timerProvider_TimerFired; _config.NamedConfigurationUpdated += _config_NamedConfigurationUpdated; @@ -1708,7 +1708,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { if (mediaSource.RequiresLooping || !(mediaSource.Container ?? string.Empty).EndsWith("ts", StringComparison.OrdinalIgnoreCase) || (mediaSource.Protocol != MediaProtocol.File && mediaSource.Protocol != MediaProtocol.Http)) { - return new EncodedRecorder(_logger, _fileSystem, _mediaEncoder, _config.ApplicationPaths, _jsonSerializer, _httpClient, _processFactory, _config, _assemblyInfo); + return new EncodedRecorder(_logger, _fileSystem, _mediaEncoder, _config.ApplicationPaths, _jsonSerializer, _processFactory, _config); } return new DirectRecorder(_logger, _httpClient, _fileSystem, _streamHelper); diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index eed2395141..9a9bae2151 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -7,7 +7,6 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Common.Configuration; -using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Library; @@ -17,7 +16,6 @@ using MediaBrowser.Model.Diagnostics; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; -using MediaBrowser.Model.Reflection; using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; @@ -27,7 +25,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { private readonly ILogger _logger; private readonly IFileSystem _fileSystem; - private readonly IHttpClient _httpClient; private readonly IMediaEncoder _mediaEncoder; private readonly IServerApplicationPaths _appPaths; private bool _hasExited; @@ -38,19 +35,23 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV private readonly IJsonSerializer _json; private readonly TaskCompletionSource _taskCompletionSource = new TaskCompletionSource(); private readonly IServerConfigurationManager _config; - private readonly IAssemblyInfo _assemblyInfo; - public EncodedRecorder(ILogger logger, IFileSystem fileSystem, IMediaEncoder mediaEncoder, IServerApplicationPaths appPaths, IJsonSerializer json, IHttpClient httpClient, IProcessFactory processFactory, IServerConfigurationManager config, IAssemblyInfo assemblyInfo) + public EncodedRecorder( + ILogger logger, + IFileSystem fileSystem, + IMediaEncoder mediaEncoder, + IServerApplicationPaths appPaths, + IJsonSerializer json, + IProcessFactory processFactory, + IServerConfigurationManager config) { _logger = logger; _fileSystem = fileSystem; _mediaEncoder = mediaEncoder; _appPaths = appPaths; _json = json; - _httpClient = httpClient; _processFactory = processFactory; _config = config; - _assemblyInfo = assemblyInfo; } private static bool CopySubtitles => false; diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs index 6b02eaea82..b825ea3b0b 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs @@ -17,15 +17,13 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV protected readonly ILogger Logger; private readonly string _dataPath; protected readonly Func EqualityComparer; - private readonly IFileSystem _fileSystem; - public ItemDataProvider(IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger, string dataPath, Func equalityComparer) + public ItemDataProvider(IJsonSerializer jsonSerializer, ILogger logger, string dataPath, Func equalityComparer) { Logger = logger; _dataPath = dataPath; EqualityComparer = equalityComparer; _jsonSerializer = jsonSerializer; - _fileSystem = fileSystem; } public IReadOnlyList GetAll() diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/SeriesTimerManager.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/SeriesTimerManager.cs index d2ad65a1e9..520b444041 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/SeriesTimerManager.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/SeriesTimerManager.cs @@ -1,6 +1,5 @@ using System; using MediaBrowser.Controller.LiveTv; -using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; @@ -8,8 +7,8 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { public class SeriesTimerManager : ItemDataProvider { - public SeriesTimerManager(IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger, string dataPath) - : base(fileSystem, jsonSerializer, logger, dataPath, (r1, r2) => string.Equals(r1.Id, r2.Id, StringComparison.OrdinalIgnoreCase)) + public SeriesTimerManager(IJsonSerializer jsonSerializer, ILogger logger, string dataPath) + : base(jsonSerializer, logger, dataPath, (r1, r2) => string.Equals(r1.Id, r2.Id, StringComparison.OrdinalIgnoreCase)) { } diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs index 1dcb02f43e..3c807a8ead 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Threading; using MediaBrowser.Controller.LiveTv; using MediaBrowser.Model.Events; -using MediaBrowser.Model.IO; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; @@ -19,8 +18,8 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV public event EventHandler> TimerFired; - public TimerManager(IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger, string dataPath, ILogger logger1) - : base(fileSystem, jsonSerializer, logger, dataPath, (r1, r2) => string.Equals(r1.Id, r2.Id, StringComparison.OrdinalIgnoreCase)) + public TimerManager(IJsonSerializer jsonSerializer, ILogger logger, string dataPath, ILogger logger1) + : base(jsonSerializer, logger, dataPath, (r1, r2) => string.Equals(r1.Id, r2.Id, StringComparison.OrdinalIgnoreCase)) { _logger = logger1; } diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs index 6d1eff187c..715f600a17 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs @@ -9,7 +9,6 @@ using MediaBrowser.Common.Configuration; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.LiveTv; -using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Model.Dto; using MediaBrowser.Model.IO; using MediaBrowser.Model.LiveTv; @@ -23,18 +22,16 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts protected readonly IServerConfigurationManager Config; protected readonly ILogger Logger; protected IJsonSerializer JsonSerializer; - protected readonly IMediaEncoder MediaEncoder; protected readonly IFileSystem FileSystem; private readonly ConcurrentDictionary _channelCache = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase); - protected BaseTunerHost(IServerConfigurationManager config, ILogger logger, IJsonSerializer jsonSerializer, IMediaEncoder mediaEncoder, IFileSystem fileSystem) + protected BaseTunerHost(IServerConfigurationManager config, ILogger logger, IJsonSerializer jsonSerializer, IFileSystem fileSystem) { Config = config; Logger = logger; JsonSerializer = jsonSerializer; - MediaEncoder = mediaEncoder; FileSystem = fileSystem; } diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs index 77b09a83de..24b100eddc 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs @@ -31,15 +31,22 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun private readonly IServerApplicationHost _appHost; private readonly ISocketFactory _socketFactory; private readonly INetworkManager _networkManager; - private readonly IEnvironmentInfo _environment; - public HdHomerunHost(IServerConfigurationManager config, ILogger logger, IJsonSerializer jsonSerializer, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IHttpClient httpClient, IServerApplicationHost appHost, ISocketFactory socketFactory, INetworkManager networkManager, IEnvironmentInfo environment) : base(config, logger, jsonSerializer, mediaEncoder, fileSystem) + public HdHomerunHost( + IServerConfigurationManager config, + ILogger logger, + IJsonSerializer jsonSerializer, + IFileSystem fileSystem, + IHttpClient httpClient, + IServerApplicationHost appHost, + ISocketFactory socketFactory, + INetworkManager networkManager) + : base(config, logger, jsonSerializer, fileSystem) { _httpClient = httpClient; _appHost = appHost; _socketFactory = socketFactory; _networkManager = networkManager; - _environment = environment; } public string Name => "HD Homerun"; diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs index 638796e2ef..fdaaf0bae7 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs @@ -26,15 +26,14 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts { private readonly IHttpClient _httpClient; private readonly IServerApplicationHost _appHost; - private readonly IEnvironmentInfo _environment; private readonly INetworkManager _networkManager; private readonly IMediaSourceManager _mediaSourceManager; - public M3UTunerHost(IServerConfigurationManager config, IMediaSourceManager mediaSourceManager, ILogger logger, IJsonSerializer jsonSerializer, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IHttpClient httpClient, IServerApplicationHost appHost, IEnvironmentInfo environment, INetworkManager networkManager) : base(config, logger, jsonSerializer, mediaEncoder, fileSystem) + public M3UTunerHost(IServerConfigurationManager config, IMediaSourceManager mediaSourceManager, ILogger logger, IJsonSerializer jsonSerializer, IFileSystem fileSystem, IHttpClient httpClient, IServerApplicationHost appHost, INetworkManager networkManager) + : base(config, logger, jsonSerializer, fileSystem) { _httpClient = httpClient; _appHost = appHost; - _environment = environment; _networkManager = networkManager; _mediaSourceManager = mediaSourceManager; } @@ -52,7 +51,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts { var channelIdPrefix = GetFullChannelIdPrefix(info); - var result = await new M3uParser(Logger, FileSystem, _httpClient, _appHost).Parse(info.Url, channelIdPrefix, info.Id, cancellationToken).ConfigureAwait(false); + var result = await new M3uParser(Logger, _httpClient, _appHost).Parse(info.Url, channelIdPrefix, info.Id, cancellationToken).ConfigureAwait(false); return result.Cast().ToList(); } @@ -115,7 +114,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts public async Task Validate(TunerHostInfo info) { - using (var stream = await new M3uParser(Logger, FileSystem, _httpClient, _appHost).GetListingsStream(info.Url, CancellationToken.None).ConfigureAwait(false)) + using (var stream = await new M3uParser(Logger, _httpClient, _appHost).GetListingsStream(info.Url, CancellationToken.None).ConfigureAwait(false)) { } diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs index 9a01c42d3b..e66f5b42e2 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs @@ -19,14 +19,12 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts public class M3uParser { private readonly ILogger _logger; - private readonly IFileSystem _fileSystem; private readonly IHttpClient _httpClient; private readonly IServerApplicationHost _appHost; - public M3uParser(ILogger logger, IFileSystem fileSystem, IHttpClient httpClient, IServerApplicationHost appHost) + public M3uParser(ILogger logger, IHttpClient httpClient, IServerApplicationHost appHost) { _logger = logger; - _fileSystem = fileSystem; _httpClient = httpClient; _appHost = appHost; }