More Metadata Stuff (#3537)
This commit is contained in:
parent
8d3dcc637e
commit
53b13da0c9
34 changed files with 4123 additions and 129 deletions
|
@ -1,9 +1,11 @@
|
|||
using System.Collections.Generic;
|
||||
using API.Entities;
|
||||
using API.Entities.Enums;
|
||||
using NotImplementedException = System.NotImplementedException;
|
||||
|
||||
namespace API.DTOs.KavitaPlus.Metadata;
|
||||
|
||||
|
||||
public class MetadataSettingsDto
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -35,6 +37,10 @@ public class MetadataSettingsDto
|
|||
/// Allow setting the Localized name
|
||||
/// </summary>
|
||||
public bool EnableLocalizedName { get; set; }
|
||||
/// <summary>
|
||||
/// Allow setting the cover image
|
||||
/// </summary>
|
||||
public bool EnableCoverImage { get; set; }
|
||||
|
||||
// Need to handle the Genre/tags stuff
|
||||
public bool EnableGenres { get; set; } = true;
|
||||
|
@ -54,6 +60,10 @@ public class MetadataSettingsDto
|
|||
/// A list of rules that allow mapping a genre/tag to another genre/tag
|
||||
/// </summary>
|
||||
public List<MetadataFieldMappingDto> FieldMappings { get; set; }
|
||||
/// <summary>
|
||||
/// A list of overrides that will enable writing to locked fields
|
||||
/// </summary>
|
||||
public List<MetadataSettingField> Overrides { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Do not allow any Genre/Tag in this list to be written to Kavita
|
||||
|
@ -67,4 +77,25 @@ public class MetadataSettingsDto
|
|||
/// Which Roles to allow metadata downloading for
|
||||
/// </summary>
|
||||
public List<PersonRole> PersonRoles { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Override list contains this field
|
||||
/// </summary>
|
||||
/// <param name="field"></param>
|
||||
/// <returns></returns>
|
||||
public bool HasOverride(MetadataSettingField field)
|
||||
{
|
||||
return Overrides.Contains(field);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If this Person role is allowed to be written
|
||||
/// </summary>
|
||||
/// <param name="character"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsPersonAllowed(PersonRole character)
|
||||
{
|
||||
return PersonRoles.Contains(character);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
namespace API.DTOs.KavitaPlus.Metadata;
|
||||
|
||||
public enum CharacterRole
|
||||
{
|
||||
Main = 0,
|
||||
Supporting = 1,
|
||||
Background = 2
|
||||
}
|
||||
|
||||
|
||||
public class SeriesCharacter
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public required string Description { get; set; }
|
||||
public required string Url { get; set; }
|
||||
public string? ImageUrl { get; set; }
|
||||
public CharacterRole Role { get; set; }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue