From 32eb0cacad652c240c11510b87b2ef1448c7fa25 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 4 Sep 2021 10:44:31 -0500 Subject: return empty browse results while scanning shares --- src/slskd/Application/SharedFileCache.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/slskd/Application/SharedFileCache.cs') 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 /// The contents of the cache. public IEnumerable 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(); // Soulseek requires that each directory in the tree have an entry in the list returned in a browse response. if -- cgit v1.2.3