diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-08-06 10:15:56 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-08-06 10:15:56 -0500 |
| commit | b8053991348e73501494af0faa37222f4d98253f (patch) | |
| tree | a21344c214946fce1b9f1bef9a96ee78ea11df05 /src | |
| parent | 4ea48efb812b2c820755a3b31130612851113d20 (diff) | |
| download | slskd-b8053991348e73501494af0faa37222f4d98253f.tar.gz | |
mask filenames in File objects also
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Application/SharedFileCache.cs | 2 |
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 |
