diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-08-02 09:39:39 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-08-02 09:39:39 -0500 |
| commit | 71815c51cb305ba97a7732be52509eb64fcd4aa3 (patch) | |
| tree | 99d691f2a3e79f2ebe59948439b243af80e765bd /src | |
| parent | 30aa9546a91d8ce0d3db672f8297dad4ad64556b (diff) | |
| download | slskd-71815c51cb305ba97a7732be52509eb64fcd4aa3.tar.gz | |
detect changes to shared config and set PendingRescan flag if changed
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Application/Service.cs | 7 | ||||
| -rw-r--r-- | src/slskd/Application/ServiceState.cs | 1 |
2 files changed, 8 insertions, 0 deletions
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); diff --git a/src/slskd/Application/ServiceState.cs b/src/slskd/Application/ServiceState.cs index 67671947..a1339d40 100644 --- a/src/slskd/Application/ServiceState.cs +++ b/src/slskd/Application/ServiceState.cs @@ -24,5 +24,6 @@ namespace slskd { public bool PendingReconnect { get; init; } public bool PendingRestart { get; init; } + public bool PendingRescan { get; init; } } }
\ No newline at end of file |
