Lumi/companion/plugins/Lumi.Companion.SongOverlay/SongOverlaySettings.cs
2026-07-29 23:41:34 +02:00

26 lines
1.1 KiB
C#

namespace Lumi.Companion.SongOverlay;
public sealed class SongOverlaySettings
{
public bool Enabled { get; set; } = true;
public string ProviderId { get; set; } = "spotify";
public HashSet<string> 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);
}
}