diff options
Diffstat (limited to 'MediaBrowser.Controller/Library/ItemResolveArgs.cs')
| -rw-r--r-- | MediaBrowser.Controller/Library/ItemResolveArgs.cs | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index 9812802e7..7bb8325f8 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Providers; using System; using System.Collections.Generic; using System.Linq; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.IO; @@ -67,13 +67,7 @@ namespace MediaBrowser.Controller.Library /// Gets a value indicating whether this instance is directory. /// </summary> /// <value><c>true</c> if this instance is directory; otherwise, <c>false</c>.</value> - public bool IsDirectory - { - get - { - return FileInfo.IsDirectory; - } - } + public bool IsDirectory => FileInfo.IsDirectory; /// <summary> /// Gets a value indicating whether this instance is vf. @@ -103,13 +97,7 @@ namespace MediaBrowser.Controller.Library /// Gets a value indicating whether this instance is physical root. /// </summary> /// <value><c>true</c> if this instance is physical root; otherwise, <c>false</c>.</value> - public bool IsPhysicalRoot - { - get - { - return IsDirectory && BaseItem.FileSystem.AreEqual(Path, _appPaths.RootFolderPath); - } - } + public bool IsPhysicalRoot => IsDirectory && BaseItem.FileSystem.AreEqual(Path, _appPaths.RootFolderPath); /// <summary> /// Gets or sets the additional locations. @@ -126,7 +114,7 @@ namespace MediaBrowser.Controller.Library { var item = parent as T; - // Just in case the user decided to nest episodes. + // Just in case the user decided to nest episodes. // Not officially supported but in some cases we can handle it. if (item == null) { @@ -150,12 +138,12 @@ namespace MediaBrowser.Controller.Library /// Adds the additional location. /// </summary> /// <param name="path">The path.</param> - /// <exception cref="System.ArgumentNullException"></exception> + /// <exception cref="ArgumentNullException"></exception> public void AddAdditionalLocation(string path) { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException(); + throw new ArgumentException("The path was empty or null.", nameof(path)); } if (AdditionalLocations == null) @@ -185,12 +173,12 @@ namespace MediaBrowser.Controller.Library /// </summary> /// <param name="name">The name.</param> /// <returns>FileSystemInfo.</returns> - /// <exception cref="System.ArgumentNullException"></exception> + /// <exception cref="ArgumentNullException"></exception> public FileSystemMetadata GetFileSystemEntryByName(string name) { if (string.IsNullOrEmpty(name)) { - throw new ArgumentNullException(); + throw new ArgumentException("The name was empty or null.", nameof(name)); } return GetFileSystemEntryByPath(System.IO.Path.Combine(Path, name)); @@ -201,12 +189,12 @@ namespace MediaBrowser.Controller.Library /// </summary> /// <param name="path">The path.</param> /// <returns>FileSystemInfo.</returns> - /// <exception cref="System.ArgumentNullException"></exception> + /// <exception cref="ArgumentNullException"></exception> public FileSystemMetadata GetFileSystemEntryByPath(string path) { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException(); + throw new ArgumentException("The path was empty or null.", nameof(path)); } foreach (var file in FileSystemChildren) @@ -240,10 +228,10 @@ namespace MediaBrowser.Controller.Library #region Equality Overrides /// <summary> - /// Determines whether the specified <see cref="System.Object" /> is equal to this instance. + /// Determines whether the specified <see cref="object" /> is equal to this instance. /// </summary> /// <param name="obj">The object to compare with the current object.</param> - /// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns> + /// <returns><c>true</c> if the specified <see cref="object" /> is equal to this instance; otherwise, <c>false</c>.</returns> public override bool Equals(object obj) { return Equals(obj as ItemResolveArgs); |
