using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using API.DTOs.KavitaPlus.Metadata;
namespace API.DTOs;
///
/// How Kavita should import the new settings
///
public enum ImportMode
{
[Description("Replace")]
Replace = 0,
[Description("Merge")]
Merge = 1,
}
///
/// How Kavita should resolve conflicts
///
public enum ConflictResolution
{
///
/// Require the user to override the default
///
[Description("Manual")]
Manual = 0,
///
/// Keep current value
///
[Description("Keep")]
Keep = 1,
///
/// Replace with imported value
///
[Description("Replace")]
Replace = 2,
}
public sealed record ImportSettingsDto
{
///
/// How Kavita should import the new settings
///
public ImportMode ImportMode { get; init; }
///
/// Default conflict resolution, override with and
///
public ConflictResolution Resolution { get; init; }
///
/// Import
///
public bool Whitelist { get; init; }
///
/// Import
///
public bool Blacklist { get; init; }
///
/// Import
///
public bool AgeRatings { get; init; }
///
/// Import
///
public bool FieldMappings { get; init; }
///
/// Override the for specific age ratings
///
/// Key is the tag
public Dictionary AgeRatingConflictResolutions { get; init; }
}
public sealed record FieldMappingsImportResultDto
{
public bool Success { get; init; }
///
/// Only present if is true
///
public MetadataSettingsDto ResultingMetadataSettings { get; init; }
///
/// Keys of the conflicting age ratings mappings
///
public List AgeRatingConflicts { get; init; }
}