Skip to content

🎧 Your Personal Streaming Service

fix(scanner): prevent ScanOnStartup when scanner is disabled

Deluan1cf3fd91618c
diff --git a/cmd/root.go b/cmd/root.go
index 74a15abc1..ff9a574ee 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -196,7 +196,8 @@ func runInitialScan(ctx context.Context) func() error {
if err != nil {
return err
}
- scanNeeded := conf.Server.Scanner.ScanOnStartup || inProgress || fullScanRequired == "1" || pidHasChanged
+ scanOnStartup := conf.Server.Scanner.Enabled && conf.Server.Scanner.ScanOnStartup
+ scanNeeded := scanOnStartup || inProgress || fullScanRequired == "1" || pidHasChanged
time.Sleep(2 * time.Second) // Wait 2 seconds before the initial scan
if scanNeeded {
s := CreateScanner(ctx)