Kavita+ Comic Metadata Matching (#3740)

This commit is contained in:
Joe Milazzo 2025-04-25 07:26:48 -06:00 committed by GitHub
parent 4521965315
commit ed154e4768
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 4207 additions and 98 deletions

View file

@ -234,4 +234,25 @@ public class Chapter : IEntityDate, IHasReadTimeEstimate, IHasCoverImage
PrimaryColor = string.Empty;
SecondaryColor = string.Empty;
}
public bool IsPersonRoleLocked(PersonRole role)
{
return role switch
{
PersonRole.Character => CharacterLocked,
PersonRole.Writer => WriterLocked,
PersonRole.Penciller => PencillerLocked,
PersonRole.Inker => InkerLocked,
PersonRole.Colorist => ColoristLocked,
PersonRole.Letterer => LettererLocked,
PersonRole.CoverArtist => CoverArtistLocked,
PersonRole.Editor => EditorLocked,
PersonRole.Publisher => PublisherLocked,
PersonRole.Translator => TranslatorLocked,
PersonRole.Imprint => ImprintLocked,
PersonRole.Team => TeamLocked,
PersonRole.Location => LocationLocked,
_ => throw new ArgumentOutOfRangeException(nameof(role), role, null)
};
}
}

View file

@ -26,6 +26,7 @@ public class ExternalSeriesMetadata
public int AverageExternalRating { get; set; } = -1;
public int AniListId { get; set; }
public int CbrId { get; set; }
public long MalId { get; set; }
public string GoogleBooksId { get; set; }

View file

@ -5,6 +5,7 @@
/// </summary>
public enum MetadataSettingField
{
#region Series Metadata
Summary = 1,
PublicationStatus = 2,
StartDate = 3,
@ -13,5 +14,18 @@ public enum MetadataSettingField
LocalizedName = 6,
Covers = 7,
AgeRating = 8,
People = 9
People = 9,
#endregion
#region Chapter Metadata
ChapterTitle = 10,
ChapterSummary = 11,
ChapterReleaseDate = 12,
ChapterPublisher = 13,
ChapterCovers = 14,
#endregion
}

View file

@ -14,6 +14,8 @@ public class MetadataSettings
/// </summary>
public bool Enabled { get; set; }
#region Series Metadata
/// <summary>
/// Allow the Summary to be written
/// </summary>
@ -42,6 +44,30 @@ public class MetadataSettings
/// Allow setting the cover image
/// </summary>
public bool EnableCoverImage { get; set; }
#endregion
#region Chapter Metadata
/// <summary>
/// Allow Summary to be set within Chapter/Issue
/// </summary>
public bool EnableChapterSummary { get; set; }
/// <summary>
/// Allow Release Date to be set within Chapter/Issue
/// </summary>
public bool EnableChapterReleaseDate { get; set; }
/// <summary>
/// Allow Title to be set within Chapter/Issue
/// </summary>
public bool EnableChapterTitle { get; set; }
/// <summary>
/// Allow Publisher to be set within Chapter/Issue
/// </summary>
public bool EnableChapterPublisher { get; set; }
/// <summary>
/// Allow setting the cover image for the Chapter/Issue
/// </summary>
public bool EnableChapterCoverImage { get; set; }
#endregion
// Need to handle the Genre/tags stuff
public bool EnableGenres { get; set; } = true;

View file

@ -10,5 +10,14 @@ public class ChapterPeople
public int PersonId { get; set; }
public virtual Person Person { get; set; }
/// <summary>
/// The source of this connection. If not Kavita, this implies Metadata Download linked this and it can be removed between matches
/// </summary>
public bool KavitaPlusConnection { get; set; }
/// <summary>
/// A weight that allows lower numbers to sort first
/// </summary>
public int OrderWeight { get; set; }
public required PersonRole Role { get; set; }
}