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 | |
| parent | 4cfe8fe5885c91edbc45d64a23f091d8c01c9726 (diff) | |
| parent | 24679af2e88b1c7fa9f083afe089d0d12db83c12 (diff) | |
Merge pull request #6851 from cvium/remove_references_to_ilibrarymanager
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Library/ILibraryManager.cs | 20 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Library/ItemResolveArgs.cs | 35 |
2 files changed, 35 insertions, 20 deletions
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 @@ -397,20 +397,6 @@ namespace MediaBrowser.Controller.Library string sortName); /// <summary> - /// Determines whether [is video file] [the specified path]. - /// </summary> - /// <param name="path">The path.</param> - /// <returns><c>true</c> if [is video file] [the specified path]; otherwise, <c>false</c>.</returns> - bool IsVideoFile(string path); - - /// <summary> - /// Determines whether [is audio file] [the specified path]. - /// </summary> - /// <param name="path">The path.</param> - /// <returns><c>true</c> if [is audio file] [the specified path]; otherwise, <c>false</c>.</returns> - bool IsAudioFile(string path); - - /// <summary> /// Gets the season number from path. /// </summary> /// <param name="path">The path.</param> @@ -625,11 +611,5 @@ namespace MediaBrowser.Controller.Library BaseItem GetParentItem(string parentId, Guid? userId); BaseItem GetParentItem(Guid? parentId, Guid? userId); - - /// <summary> - /// Gets or creates a static instance of <see cref="NamingOptions"/>. - /// </summary> - /// <returns>An instance of the <see cref="NamingOptions"/> class.</returns> - NamingOptions GetNamingOptions(); } } 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> |
