aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-09-21 20:36:05 -0500
committerJP Dillingham <jp@dillingham.me>2022-09-21 20:36:05 -0500
commit1887d69479c160c5552f040ea3ba2a4765991602 (patch)
treee2c450ef3d366efc4bc3cb39f113896039a37290 /src
parentf61ee9c602ba26688db090b0458ab49b768d5170 (diff)
downloadslskd-1887d69479c160c5552f040ea3ba2a4765991602.tar.gz
create cache if it cant be loaded
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Application.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index cab2b649..a64fdf36 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -375,6 +375,11 @@ namespace slskd
{
Log.Warning("Unable to load share cache from disk. A share scan is required.");
+ // drop all of the existing tables and recreate them
+ Log.Information("Recreating share cache...");
+ await Shares.CreateAsync(discardExisting: true);
+ Log.Information("Share cache ready.");
+
State.SetValue(state => state with { Shares = state.Shares with { ScanPending = true } });
if (OptionsAtStartup.Flags.NoShareScan)