aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Transfers
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-06-05 19:18:18 -0500
committerJP Dillingham <jp@dillingham.me>2026-06-06 07:30:00 -0500
commit5ed58b906b98c0f1b06147ed4db18c9bc2f1ffdf (patch)
treea78841dea42b9abe73d538ff75382e457370067a /src/slskd/Transfers
parent62134e78472a51ef0becff9c0850f635933ab506 (diff)
downloadslskd-5ed58b906b98c0f1b06147ed4db18c9bc2f1ffdf.tar.gz
small tweaks
Diffstat (limited to 'src/slskd/Transfers')
-rw-r--r--src/slskd/Transfers/Downloads/DownloadService.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs
index 0f7805ba..ad91ba2c 100644
--- a/src/slskd/Transfers/Downloads/DownloadService.cs
+++ b/src/slskd/Transfers/Downloads/DownloadService.cs
@@ -815,7 +815,7 @@ namespace slskd.Transfers.Downloads
// full remote path, e.g. '@@abcd\Foo\Bar\Baz\Qux.ext' => '@@abcd\Foo\Bar\Baz'
// retains the path root, if there is one (Soulseek NS does this), which may not be what
// people want, so possibly revisit and add StripPathRoot()
- source_path = (FileSafety.GetDirectoryNameSafely(filename) ?? string.Empty).TrimEnd('/', '\\');
+ source_path = (FileSafety.GetDirectoryNameSafely(filename, retainRoot: false) ?? string.Empty).TrimEnd('/', '\\');
// name of the remote parent directory, so using the example above, 'Baz'
source_directory = (FileSafety.GetFileNameSafely(source_path) ?? string.Empty).TrimEnd('/', '\\');
@@ -1249,7 +1249,7 @@ namespace slskd.Transfers.Downloads
var incompleteDirectory = OptionsMonitor.CurrentValue.Directories.Incomplete;
var sanitizedUsername = FileSafety.SanitizePathSegment(transfer.Username);
var sanitizedFilename = FileSafety.GetFileNameSafely(transfer.Filename, sanitize: true);
- var sanitizedRemotePath = FileSafety.GetDirectoryNameSafely(transfer.Filename, sanitize: true);
+ var sanitizedRemotePath = FileSafety.GetDirectoryNameSafely(transfer.Filename, sanitize: true) ?? string.Empty;
var incompleteFilename = FileSafety.CombineSafely(incompleteDirectory, sanitizedUsername, sanitizedRemotePath, sanitizedFilename);