aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2023-09-13 17:30:50 +0200
committerBond_009 <bond.009@outlook.com>2023-09-13 17:30:50 +0200
commit767a42fbdbbb2db30313d0935f322f162ebeced4 (patch)
tree91b187902579eac2fd25d731310f729e9803c148 /Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs
parent3f19befc594670d72c2611f103e703633960e0aa (diff)
Minor LibraryMonitor improvements
* Enable nullable * Add a fast return to ReportFileSystemChanged when path should be ignored * Use Span overloads of Path.* functions where possible * IFileSystem: remove NormalizePath as Path.TrimEndingDirectorySeparator already checks if it's a root path
Diffstat (limited to 'Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs')
-rw-r--r--Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs11
1 files changed, 2 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs
index c2aab3879..5776c7a7c 100644
--- a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs
+++ b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs
@@ -8,24 +8,17 @@ namespace Emby.Server.Implementations.IO
{
public class MbLinkShortcutHandler : IShortcutHandler
{
- private readonly IFileSystem _fileSystem;
-
- public MbLinkShortcutHandler(IFileSystem fileSystem)
- {
- _fileSystem = fileSystem;
- }
-
public string Extension => ".mblink";
public string? Resolve(string shortcutPath)
{
ArgumentException.ThrowIfNullOrEmpty(shortcutPath);
- if (string.Equals(Path.GetExtension(shortcutPath), ".mblink", StringComparison.OrdinalIgnoreCase))
+ if (Path.GetExtension(shortcutPath.AsSpan()).Equals(".mblink", StringComparison.OrdinalIgnoreCase))
{
var path = File.ReadAllText(shortcutPath);
- return _fileSystem.NormalizePath(path);
+ return Path.TrimEndingDirectorySeparator(path);
}
return null;