namespace Lumi.Companion.SongOverlay; public sealed class SongOverlaySettings { public bool Enabled { get; set; } = true; public string ProviderId { get; set; } = "spotify"; public HashSet EnabledSources { get; set; } = MediaSourceCatalog.Defaults(); public int HeartbeatSeconds { get; set; } = 30; public int SeekThresholdMilliseconds { get; set; } = 1500; public bool SendCoverArt { get; set; } = true; public bool UseSearchLinkFallback { get; set; } = true; public string SpotifyClientId { get; set; } = ""; public string ProtectedSpotifyRefreshToken { get; set; } = ""; public void Normalize() { ProviderId = "windows-media"; EnabledSources ??= MediaSourceCatalog.Defaults(); EnabledSources = EnabledSources .Where(id => MediaSourceCatalog.All.Any(source => source.Id == id)) .ToHashSet(StringComparer.Ordinal); HeartbeatSeconds = Math.Clamp(HeartbeatSeconds, 15, 300); SeekThresholdMilliseconds = Math.Clamp(SeekThresholdMilliseconds, 500, 10000); } }