aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Library
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2021-04-22 01:23:24 +0200
committerBond_009 <bond.009@outlook.com>2021-04-22 01:24:21 +0200
commitb323044139fd7a0b63a717101f7ccb7f03f3f125 (patch)
tree5300857bbba66a3d1d4f0c4929aa0a5749bc6c3a /MediaBrowser.Controller/Library
parent95ab603a40b96499e3a3b732f31aacc458ca8a2c (diff)
Reduce string allocations/fs lookups in resolve code
Diffstat (limited to 'MediaBrowser.Controller/Library')
-rw-r--r--MediaBrowser.Controller/Library/ItemResolveArgs.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs
index 12a311dc3..df8842237 100644
--- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs
+++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs
@@ -60,10 +60,10 @@ namespace MediaBrowser.Controller.Library
public FileSystemMetadata FileInfo { get; set; }
/// <summary>
- /// Gets or sets the path.
+ /// Gets the path.
/// </summary>
/// <value>The path.</value>
- public string Path { get; set; }
+ public string Path => FileInfo.FullName;
/// <summary>
/// Gets a value indicating whether this instance is directory.
@@ -87,7 +87,7 @@ namespace MediaBrowser.Controller.Library
return false;
}
- var parentDir = System.IO.Path.GetDirectoryName(Path) ?? string.Empty;
+ var parentDir = FileInfo.DirectoryName ?? string.Empty;
return parentDir.Length > _appPaths.RootFolderPath.Length
&& parentDir.StartsWith(_appPaths.RootFolderPath, StringComparison.OrdinalIgnoreCase);