aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-09-04 10:44:31 -0500
committerJP Dillingham <jpdillingham@gmail.com>2021-09-04 10:44:31 -0500
commit32eb0cacad652c240c11510b87b2ef1448c7fa25 (patch)
tree612ffbc295fe13465d0c7a42f3f06627da3d2eb7 /src
parent3c986105667e9947d6c64f809d9b0d451e82b735 (diff)
downloadslskd-32eb0cacad652c240c11510b87b2ef1448c7fa25.tar.gz
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