Merge pull request #6851 from cvium/remove_references_to_ilibrarymanager

This commit is contained in:
Cody Robibero
2021-11-15 15:45:49 -07:00
committed by GitHub
17 changed files with 184 additions and 212 deletions

View File

@@ -396,20 +396,6 @@ namespace MediaBrowser.Controller.Library
string viewType,
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>
@@ -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();
}
}

View File

@@ -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>
@@ -236,6 +237,40 @@ namespace MediaBrowser.Controller.Library
return CollectionType;
}
/// <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>