diff options
| author | Cody Robibero <cody@robibe.ro> | 2021-11-15 15:45:49 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-15 15:45:49 -0700 |
| commit | c32a421ea79c24760e1beabe9cfa0a0fffce67c4 (patch) | |
| tree | a7a0ee5f2a99ac5a60a4cc2a3851a7f265acce77 /MediaBrowser.Controller/Library/ItemResolveArgs.cs | |
| parent | 4cfe8fe5885c91edbc45d64a23f091d8c01c9726 (diff) | |
| parent | 24679af2e88b1c7fa9f083afe089d0d12db83c12 (diff) | |
Merge pull request #6851 from cvium/remove_references_to_ilibrarymanager
Diffstat (limited to 'MediaBrowser.Controller/Library/ItemResolveArgs.cs')
| -rw-r--r-- | MediaBrowser.Controller/Library/ItemResolveArgs.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index bfc1e4857..91d162b41 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -36,6 +36,7 @@ namespace MediaBrowser.Controller.Library DirectoryService = directoryService; } + // TODO remove dependencies as properties, they should be injected where it makes sense public IDirectoryService DirectoryService { get; } /// <summary> @@ -237,6 +238,40 @@ namespace MediaBrowser.Controller.Library } /// <summary> + /// Gets the configured content type for the path. + /// </summary> + /// <remarks> + /// This is subject to future refactoring as it relies on a static property in BaseItem. + /// </remarks> + /// <returns>The configured content type.</returns> + public string GetConfiguredContentType() + { + return BaseItem.LibraryManager.GetConfiguredContentType(Path); + } + + /// <summary> + /// Gets the file system children that do not hit the ignore file check. + /// </summary> + /// <remarks> + /// This is subject to future refactoring as it relies on a static property in BaseItem. + /// </remarks> + /// <returns>The file system children that are not ignored.</returns> + public IEnumerable<FileSystemMetadata> 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; + } + } + + /// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns> |
