diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-09-04 11:46:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-04 11:46:55 -0500 |
| commit | 18a543b66b5a4052a0e8eb9e40584d61bf2cd3b5 (patch) | |
| tree | 612ffbc295fe13465d0c7a42f3f06627da3d2eb7 /src/slskd/Application/SharedFileCache.cs | |
| parent | 3c986105667e9947d6c64f809d9b0d451e82b735 (diff) | |
| parent | 32eb0cacad652c240c11510b87b2ef1448c7fa25 (diff) | |
| download | slskd-18a543b66b5a4052a0e8eb9e40584d61bf2cd3b5.tar.gz | |
Merge pull request #184 from slskd/share-message
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 |
