feat(server): rename ScanSchedule conf to Scanner.Schedule, for consistency

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2025-02-28 12:52:20 -08:00
parent f3cb85cb0d
commit de37e0f720
2 changed files with 10 additions and 27 deletions

View file

@ -137,18 +137,18 @@ func startServer(ctx context.Context) func() error {
// schedulePeriodicScan schedules a periodic scan of the music library, if configured.
func schedulePeriodicScan(ctx context.Context) func() error {
return func() error {
schedule := conf.Server.ScanSchedule
schedule := conf.Server.Scanner.Schedule
if schedule == "" {
log.Warn(ctx, "Periodic scan is DISABLED")
return nil
}
scanner := CreateScanner(ctx)
s := CreateScanner(ctx)
schedulerInstance := scheduler.GetInstance()
log.Info("Scheduling periodic scan", "schedule", schedule)
err := schedulerInstance.Add(schedule, func() {
_, err := scanner.ScanAll(ctx, false)
_, err := s.ScanAll(ctx, false)
if err != nil {
log.Error(ctx, "Error executing periodic scan", err)
}