diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-05-30 18:24:50 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-05-30 18:24:50 -0500 |
| commit | b52215184538991dfe1012c1017437edeb2e7b70 (patch) | |
| tree | 17d3329db618f8f9e685ec1be5577c0dce4547cd /src/slskd/Common | |
| parent | ba3d4690e132a966567db40c8b778c5ed3922833 (diff) | |
| download | slskd-b52215184538991dfe1012c1017437edeb2e7b70.tar.gz | |
remove the option to strip the root when getting directory
Diffstat (limited to 'src/slskd/Common')
| -rw-r--r-- | src/slskd/Common/FileSafety.cs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/slskd/Common/FileSafety.cs b/src/slskd/Common/FileSafety.cs index 6c1ce8b6..acbe273b 100644 --- a/src/slskd/Common/FileSafety.cs +++ b/src/slskd/Common/FileSafety.cs @@ -247,22 +247,16 @@ public static class FileSafety /// each of the remaining segments. /// </summary> /// <param name="path">The path from which to extract the directory name.</param> - /// <param name="stripRoot">An optional value indicating that root segments should not be stripped.</param> /// <param name="sanitize">An optional value indicating that path segments should not be sanitized.</param> /// <param name="os">An optional operating system override, for testing.</param> /// <returns>The directory name.</returns> /// <exception cref="ArgumentNullException">Thrown if the specified path is null.</exception> - public static string GetDirectoryNameSafely(string path, bool stripRoot = true, bool sanitize = true, OSPlatform? os = null) + public static string GetDirectoryNameSafely(string path, bool sanitize = true, OSPlatform? os = null) { ArgumentNullException.ThrowIfNull(path); var local = LocalizePath(path, os: os); - if (stripRoot) - { - local = StripPathRoot(local); - } - return string.Join(Path.DirectorySeparatorChar, local .Split(Path.DirectorySeparatorChar) .SkipLast(1) |
