diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-09-04 10:44:31 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-09-04 10:44:31 -0500 |
| commit | 32eb0cacad652c240c11510b87b2ef1448c7fa25 (patch) | |
| tree | 612ffbc295fe13465d0c7a42f3f06627da3d2eb7 /src/slskd/Application/SharedFileCache.cs | |
| parent | 3c986105667e9947d6c64f809d9b0d451e82b735 (diff) | |
| download | slskd-32eb0cacad652c240c11510b87b2ef1448c7fa25.tar.gz | |
return empty browse results while scanning shares
Diffstat (limited to 'src/slskd/Application/SharedFileCache.cs')
| -rw-r--r-- | src/slskd/Application/SharedFileCache.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/slskd/Application/SharedFileCache.cs b/src/slskd/Application/SharedFileCache.cs index a469de22..7bd30d2a 100644 --- a/src/slskd/Application/SharedFileCache.cs +++ b/src/slskd/Application/SharedFileCache.cs @@ -66,6 +66,12 @@ namespace slskd /// <returns>The contents of the cache.</returns> public IEnumerable<Directory> Browse() { + // ignore requests while the cache is building + if (SyncRoot.CurrentCount == 0) + { + return new[] { new Directory("Scanning shares, please check back in a few minutes.") }; + } + var directories = new ConcurrentDictionary<string, Directory>(); // Soulseek requires that each directory in the tree have an entry in the list returned in a browse response. if |
