diff --git a/conf/configuration.go b/conf/configuration.go index 7292c7dfe..a9fee00e4 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -125,6 +125,7 @@ type configOptions struct { DevAlbumInfoTimeToLive time.Duration DevExternalScanner bool DevScannerThreads uint + DevSelectiveWatcher bool DevInsightsInitialDelay time.Duration DevEnablePlayerInsights bool DevEnablePluginsInsights bool @@ -600,6 +601,7 @@ func setViperDefaults() { viper.SetDefault("devalbuminfotimetolive", consts.AlbumInfoTimeToLive) viper.SetDefault("devexternalscanner", true) viper.SetDefault("devscannerthreads", 5) + viper.SetDefault("devselectivewatcher", true) viper.SetDefault("devinsightsinitialdelay", consts.InsightsInitialDelay) viper.SetDefault("devenableplayerinsights", true) viper.SetDefault("devenablepluginsinsights", true) diff --git a/scanner/watcher.go b/scanner/watcher.go index 849ddf91a..80cada050 100644 --- a/scanner/watcher.go +++ b/scanner/watcher.go @@ -99,7 +99,12 @@ func (w *watcher) Run(ctx context.Context) error { targets = make(map[model.ScanTarget]struct{}) go func() { - _, err := w.scanner.ScanFolders(ctx, false, targetSlice) + var err error + if conf.Server.DevSelectiveWatcher { + _, err = w.scanner.ScanFolders(ctx, false, targetSlice) + } else { + _, err = w.scanner.ScanAll(ctx, false) + } if err != nil { log.Error(ctx, "Watcher: Error scanning", err) } else {