using JetBrains.Annotations; namespace Recyclarr.TrashLib.Config.Services; public abstract record ServiceConfiguration : IServiceConfiguration { public abstract SupportedServices ServiceType { get; } public required string InstanceName { get; init; } public Uri BaseUrl { get; set; } = new("about:empty"); public string ApiKey { get; init; } = ""; public ICollection CustomFormats { get; init; } = new List(); public bool DeleteOldCustomFormats { get; [UsedImplicitly] init; } public bool ReplaceExistingCustomFormats { get; init; } public QualityDefinitionConfig? QualityDefinition { get; init; } public IReadOnlyCollection QualityProfiles { get; init; } = Array.Empty(); } [UsedImplicitly(ImplicitUseTargetFlags.WithMembers)] public record CustomFormatConfig { public ICollection TrashIds { get; init; } = new List(); public ICollection QualityProfiles { get; init; } = new List(); } [UsedImplicitly(ImplicitUseTargetFlags.WithMembers)] public record QualityProfileScoreConfig { public string Name { get; init; } = ""; public int? Score { get; init; } } [UsedImplicitly(ImplicitUseTargetFlags.WithMembers)] public record QualityDefinitionConfig { public string Type { get; init; } = ""; public decimal? PreferredRatio { get; set; } } [UsedImplicitly(ImplicitUseTargetFlags.WithMembers)] public record QualityProfileQualityConfig { public string Name { get; init; } = ""; public bool Enabled { get; init; } public IReadOnlyCollection Qualities { get; init; } = Array.Empty(); } public enum QualitySortAlgorithm { Top, Bottom } public record ResetUnmatchedScoresConfig { public bool Enabled { get; init; } public IReadOnlyCollection Except { get; init; } = Array.Empty(); } public record QualityProfileConfig { public string Name { get; init; } = ""; public bool? UpgradeAllowed { get; init; } public string? UpgradeUntilQuality { get; init; } public int? UpgradeUntilScore { get; init; } public int? MinFormatScore { get; init; } public string? ScoreSet { get; init; } public ResetUnmatchedScoresConfig ResetUnmatchedScores { get; init; } = new(); public QualitySortAlgorithm QualitySort { get; init; } public IReadOnlyCollection Qualities { get; init; } = Array.Empty(); }