diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-08-24 08:25:32 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-08-24 08:25:32 -0500 |
| commit | b49de6c5458e9febc884d090df330b485a1f15b9 (patch) | |
| tree | 6730e993a0699084a481c62e4a449bd5d6258ded /src/slskd/Application/SharedFileCache.cs | |
| parent | 6795ced13828958514fbf65323e824da257c0f9d (diff) | |
| download | slskd-b49de6c5458e9febc884d090df330b485a1f15b9.tar.gz | |
filter files when scanning shares
Diffstat (limited to 'src/slskd/Application/SharedFileCache.cs')
| -rw-r--r-- | src/slskd/Application/SharedFileCache.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/slskd/Application/SharedFileCache.cs b/src/slskd/Application/SharedFileCache.cs index c2200daf..7bdc69f3 100644 --- a/src/slskd/Application/SharedFileCache.cs +++ b/src/slskd/Application/SharedFileCache.cs @@ -192,6 +192,11 @@ namespace slskd // qualified name the only time this *should* cause problems is if one of the shares is a subdirectory of another. foreach (var file in newFiles) { + if (OptionsMonitor.CurrentValue.Filters.File.Any(pattern => Regex.IsMatch(file.Key, pattern))) + { + continue; + } + if (files.ContainsKey(file.Key)) { Log.Warning($"File {file.Key} shared in directory {directory} has already been cached. This is probably a misconfiguration of the shared directories (is a subdirectory being re-shared?)."); |
