From 4f45c526748132f3ce19fc8b357f498d8100671d Mon Sep 17 00:00:00 2001 From: cvium Date: Mon, 15 Nov 2021 15:56:02 +0100 Subject: Remove ILibraryManager as a dependency in resolvers etc. --- MediaBrowser.Controller/Library/ItemResolveArgs.cs | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'MediaBrowser.Controller/Library/ItemResolveArgs.cs') diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index bfc1e4857..8ce40868e 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -36,6 +36,7 @@ namespace MediaBrowser.Controller.Library DirectoryService = directoryService; } + // TODO make this shit gone public IDirectoryService DirectoryService { get; } /// @@ -236,6 +237,40 @@ namespace MediaBrowser.Controller.Library return CollectionType; } + /// + /// Gets the configured content type for the path. + /// + /// + /// This is subject to future refactoring as it relies on a static property in BaseItem. + /// + /// The configured content type. + public string GetConfiguredContentType() + { + return BaseItem.LibraryManager.GetConfiguredContentType(Path); + } + + /// + /// Gets the file system children that do not hit the ignore file check. + /// + /// + /// This is subject to future refactoring as it relies on a static property in BaseItem. + /// + /// The file system children that are not ignored. + public IEnumerable GetActualFileSystemChildren() + { + var numberOfChildren = FileSystemChildren.Length; + for (var i = 0; i < numberOfChildren; i++) + { + var child = FileSystemChildren[i]; + if (BaseItem.LibraryManager.IgnoreFile(child, Parent)) + { + continue; + } + + yield return child; + } + } + /// /// Returns a hash code for this instance. /// -- cgit v1.2.3 From 24679af2e88b1c7fa9f083afe089d0d12db83c12 Mon Sep 17 00:00:00 2001 From: cvium Date: Mon, 15 Nov 2021 16:01:34 +0100 Subject: Fix comment --- MediaBrowser.Controller/Library/ItemResolveArgs.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MediaBrowser.Controller/Library/ItemResolveArgs.cs') diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index 8ce40868e..91d162b41 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -36,7 +36,7 @@ namespace MediaBrowser.Controller.Library DirectoryService = directoryService; } - // TODO make this shit gone + // TODO remove dependencies as properties, they should be injected where it makes sense public IDirectoryService DirectoryService { get; } /// -- cgit v1.2.3