aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Application/SharedFileCache.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-08-06 10:15:56 -0500
committerJP Dillingham <jpdillingham@gmail.com>2021-08-06 10:15:56 -0500
commitb8053991348e73501494af0faa37222f4d98253f (patch)
treea21344c214946fce1b9f1bef9a96ee78ea11df05 /src/slskd/Application/SharedFileCache.cs
parent4ea48efb812b2c820755a3b31130612851113d20 (diff)
downloadslskd-b8053991348e73501494af0faa37222f4d98253f.tar.gz
mask filenames in File objects also
Diffstat (limited to 'src/slskd/Application/SharedFileCache.cs')
-rw-r--r--src/slskd/Application/SharedFileCache.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/slskd/Application/SharedFileCache.cs b/src/slskd/Application/SharedFileCache.cs
index 761941f2..f52f298a 100644
--- a/src/slskd/Application/SharedFileCache.cs
+++ b/src/slskd/Application/SharedFileCache.cs
@@ -160,7 +160,7 @@ namespace slskd
// recursively find all files in the directory and stick a record in a dictionary, keyed on the sanitized
// filename and with a value of a Soulseek.File object
var newFiles = System.IO.Directory.GetFiles(directory, "*", SearchOption.TopDirectoryOnly)
- .Select(f => new File(1, f.Replace("/", @"\"), new FileInfo(f).Length, Path.GetExtension(f)))
+ .Select(f => new File(1, f.Replace("/", @"\").ReplaceFirst(mask.Value, mask.Key), new FileInfo(f).Length, Path.GetExtension(f)))
.ToDictionary(f => f.Filename, f => f);
// merge the new dictionary with the rest this will overwrite any duplicate keys, but keys are the fully