package services

import (
	"testing"
	"time"
)

func TestMediaScanner_GetPollInterval(t *testing.T) {
	t.Run("nil db returns default", func(t *testing.T) {
		scanner := &MediaScanner{
			db:            nil,
			settingsCache: NewSettingsCache(30 * time.Second),
		}
		interval := scanner.GetPollInterval()
		if interval != 5*time.Minute {
			t.Errorf("expected 5m, got %v", interval)
		}
	})
}

func TestMediaScanner_GetAutoScanEnabled(t *testing.T) {
	t.Run("nil db returns default true", func(t *testing.T) {
		scanner := &MediaScanner{
			db:            nil,
			settingsCache: NewSettingsCache(30 * time.Second),
		}
		enabled := scanner.GetAutoScanEnabled()
		if enabled != true {
			t.Errorf("expected true, got %v", enabled)
		}
	})
}
