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/ILibraryManager.cs | 20 ------------- MediaBrowser.Controller/Library/ItemResolveArgs.cs | 35 ++++++++++++++++++++++ 2 files changed, 35 insertions(+), 20 deletions(-) (limited to 'MediaBrowser.Controller/Library') diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index d40e56c7d..1e1e2adb8 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -396,20 +396,6 @@ namespace MediaBrowser.Controller.Library string viewType, string sortName); - /// - /// Determines whether [is video file] [the specified path]. - /// - /// The path. - /// true if [is video file] [the specified path]; otherwise, false. - bool IsVideoFile(string path); - - /// - /// Determines whether [is audio file] [the specified path]. - /// - /// The path. - /// true if [is audio file] [the specified path]; otherwise, false. - bool IsAudioFile(string path); - /// /// Gets the season number from path. /// @@ -625,11 +611,5 @@ namespace MediaBrowser.Controller.Library BaseItem GetParentItem(string parentId, Guid? userId); BaseItem GetParentItem(Guid? parentId, Guid? userId); - - /// - /// Gets or creates a static instance of . - /// - /// An instance of the class. - NamingOptions GetNamingOptions(); } } 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') 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