aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-09-04 11:46:55 -0500
committerGitHub <noreply@github.com>2021-09-04 11:46:55 -0500
commit18a543b66b5a4052a0e8eb9e40584d61bf2cd3b5 (patch)
tree612ffbc295fe13465d0c7a42f3f06627da3d2eb7 /src
parent3c986105667e9947d6c64f809d9b0d451e82b735 (diff)
parent32eb0cacad652c240c11510b87b2ef1448c7fa25 (diff)
downloadslskd-18a543b66b5a4052a0e8eb9e40584d61bf2cd3b5.tar.gz
Merge pull request #184 from slskd/share-message
Return empty browse results while scanning shares
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Application/SharedFileCache.cs6
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