More improvements

This commit is contained in:
Bond_009
2021-05-05 15:30:32 +02:00
parent 787bcd4a83
commit bcb4010db6
9 changed files with 32 additions and 47 deletions

View File

@@ -14,14 +14,14 @@ namespace MediaBrowser.Controller.Library
/// These are arguments relating to the file system that are collected once and then referred to
/// whenever needed. Primarily for entity resolution.
/// </summary>
public class ItemResolveArgs : EventArgs
public class ItemResolveArgs
{
/// <summary>
/// The _app paths.
/// </summary>
private readonly IServerApplicationPaths _appPaths;
public IDirectoryService DirectoryService { get; private set; }
private LibraryOptions _libraryOptions;
/// <summary>
/// Initializes a new instance of the <see cref="ItemResolveArgs" /> class.
@@ -34,17 +34,18 @@ namespace MediaBrowser.Controller.Library
DirectoryService = directoryService;
}
public IDirectoryService DirectoryService { get; }
/// <summary>
/// Gets the file system children.
/// </summary>
/// <value>The file system children.</value>
public FileSystemMetadata[] FileSystemChildren { get; set; }
public LibraryOptions LibraryOptions { get; set; }
public LibraryOptions GetLibraryOptions()
public LibraryOptions LibraryOptions
{
return LibraryOptions ?? (LibraryOptions = Parent == null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent));
get => _libraryOptions ??= Parent == null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent);
set => _libraryOptions = value;
}
/// <summary>
@@ -139,7 +140,7 @@ namespace MediaBrowser.Controller.Library
/// Adds the additional location.
/// </summary>
/// <param name="path">The path.</param>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="ArgumentNullException"><paramref name="path"/> is <c>null</c> or empty.</exception>
public void AddAdditionalLocation(string path)
{
if (string.IsNullOrEmpty(path))
@@ -148,7 +149,6 @@ namespace MediaBrowser.Controller.Library
}
AdditionalLocations ??= new List<string>();
AdditionalLocations.Add(path);
}
@@ -172,7 +172,7 @@ namespace MediaBrowser.Controller.Library
/// </summary>
/// <param name="name">The name.</param>
/// <returns>FileSystemInfo.</returns>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c> or empty.</exception>
public FileSystemMetadata GetFileSystemEntryByName(string name)
{
if (string.IsNullOrEmpty(name))