From 177de7269baa84523990e373760fbaa9b23790e7 Mon Sep 17 00:00:00 2001 From: Deluan Date: Mon, 23 Jun 2025 10:09:07 -0400 Subject: [PATCH] fix(scanner): always check for needed initial scan. Relates to #4246 Signed-off-by: Deluan --- cmd/root.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index f3473f5a..662415c2 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -84,8 +84,8 @@ func runNavidrome(ctx context.Context) { g.Go(startInsightsCollector(ctx)) g.Go(scheduleDBOptimizer(ctx)) g.Go(startPluginManager(ctx)) + g.Go(runInitialScan(ctx)) if conf.Server.Scanner.Enabled { - g.Go(runInitialScan(ctx)) g.Go(startScanWatcher(ctx)) g.Go(schedulePeriodicScan(ctx)) } else { @@ -174,6 +174,7 @@ func pidHashChanged(ds model.DataStore) (bool, error) { return !strings.EqualFold(pidAlbum, conf.Server.PID.Album) || !strings.EqualFold(pidTrack, conf.Server.PID.Track), nil } +// runInitialScan runs an initial scan of the music library if needed. func runInitialScan(ctx context.Context) func() error { return func() error { ds := CreateDataStore()