From 71815c51cb305ba97a7732be52509eb64fcd4aa3 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 2 Aug 2021 09:39:39 -0500 Subject: detect changes to shared config and set PendingRescan flag if changed --- src/slskd/Application/Service.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/slskd/Application/Service.cs') diff --git a/src/slskd/Application/Service.cs b/src/slskd/Application/Service.cs index 3d019dd3..8b88e8ff 100644 --- a/src/slskd/Application/Service.cs +++ b/src/slskd/Application/Service.cs @@ -226,6 +226,13 @@ namespace slskd pendingReconnect |= requiresReconnect; } + if (PreviousOptions.Directories.Shared.Except(newOptions.Directories.Shared).Any() + || newOptions.Directories.Shared.Except(PreviousOptions.Directories.Shared).Any()) + { + StateMonitor.SetValue(state => state with { PendingReconnect = true }); + Logger.Information("Shared directory configuration changed. Shares must be re-scanned for changes to take effect."); + } + // determine whether any Soulseek options changed. if so, we need to construct a patch // and invoke ReconfigureOptionsAsync(). var slskDiff = PreviousOptions.Soulseek.DiffWith(newOptions.Soulseek); -- cgit v1.2.3