using System.Collections.Generic; using API.Entities; using API.Entities.Enums; using API.Entities.MetadataMatching; using NotImplementedException = System.NotImplementedException; namespace API.DTOs.KavitaPlus.Metadata; public sealed record MetadataSettingsDto { /// /// If writing any sort of metadata from upstream (AniList, Hardcover) source is allowed /// public bool Enabled { get; set; } /// /// Allow the Summary to be written /// public bool EnableSummary { get; set; } /// /// Allow Publication status to be derived and updated /// public bool EnablePublicationStatus { get; set; } /// /// Allow Relationships between series to be set /// public bool EnableRelationships { get; set; } /// /// Allow People to be created (including downloading images) /// public bool EnablePeople { get; set; } /// /// Allow Start date to be set within the Series /// public bool EnableStartDate { get; set; } /// /// Allow setting the Localized name /// public bool EnableLocalizedName { get; set; } /// /// Allow setting the cover image /// public bool EnableCoverImage { get; set; } #region Chapter Metadata /// /// Allow Summary to be set within Chapter/Issue /// public bool EnableChapterSummary { get; set; } /// /// Allow Release Date to be set within Chapter/Issue /// public bool EnableChapterReleaseDate { get; set; } /// /// Allow Title to be set within Chapter/Issue /// public bool EnableChapterTitle { get; set; } /// /// Allow Publisher to be set within Chapter/Issue /// public bool EnableChapterPublisher { get; set; } /// /// Allow setting the cover image for the Chapter/Issue /// public bool EnableChapterCoverImage { get; set; } #endregion // Need to handle the Genre/tags stuff public bool EnableGenres { get; set; } = true; public bool EnableTags { get; set; } = true; /// /// For Authors and Writers, how should names be stored (Exclusively applied for AniList). This does not affect Character names. /// public bool FirstLastPeopleNaming { get; set; } /// /// Any Genres or Tags that if present, will trigger an Age Rating Override. Highest rating will be prioritized for matching. /// public Dictionary AgeRatingMappings { get; set; } /// /// A list of rules that allow mapping a genre/tag to another genre/tag /// public List FieldMappings { get; set; } /// /// A list of overrides that will enable writing to locked fields /// public List Overrides { get; set; } /// /// Do not allow any Genre/Tag in this list to be written to Kavita /// public List Blacklist { get; set; } /// /// Only allow these Tags to be written to Kavita /// public List Whitelist { get; set; } /// /// Which Roles to allow metadata downloading for /// public List PersonRoles { get; set; } /// /// Override list contains this field /// /// /// public bool HasOverride(MetadataSettingField field) { return Overrides.Contains(field); } /// /// If this Person role is allowed to be written /// /// /// public bool IsPersonAllowed(PersonRole character) { return PersonRoles.Contains(character); } }