Browse by Genre/Tag/Person with new metadata system for People (#3835)

Co-authored-by: Stepan Goremykin <s.goremykin@proton.me>
Co-authored-by: goremykin <goremukin@gmail.com>
Co-authored-by: Christopher <39032787+MrRobotjs@users.noreply.github.com>
Co-authored-by: Fesaa <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
Joe Milazzo 2025-06-14 12:14:04 -05:00 committed by GitHub
parent 00c4712fc3
commit c52ed1f65d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
147 changed files with 6612 additions and 958 deletions

View file

@ -0,0 +1,8 @@
namespace API.DTOs.Filtering;
public enum PersonSortField
{
Name = 1,
SeriesCount = 2,
ChapterCount = 3
}

View file

@ -8,3 +8,12 @@ public sealed record SortOptions
public SortField SortField { get; set; }
public bool IsAscending { get; set; } = true;
}
/// <summary>
/// All Sorting Options for a query related to Person Entity
/// </summary>
public sealed record PersonSortOptions
{
public PersonSortField SortField { get; set; }
public bool IsAscending { get; set; } = true;
}

View file

@ -56,5 +56,12 @@ public enum FilterField
/// Last time User Read
/// </summary>
ReadLast = 32,
}
public enum PersonFilterField
{
Role = 1,
Name = 2,
SeriesCount = 3,
ChapterCount = 4,
}

View file

@ -1,4 +1,6 @@
namespace API.DTOs.Filtering.v2;
using API.DTOs.Metadata.Browse.Requests;
namespace API.DTOs.Filtering.v2;
public sealed record FilterStatementDto
{
@ -6,3 +8,10 @@ public sealed record FilterStatementDto
public FilterField Field { get; set; }
public string Value { get; set; }
}
public sealed record PersonFilterStatementDto
{
public FilterComparison Comparison { get; set; }
public PersonFilterField Field { get; set; }
public string Value { get; set; }
}

View file

@ -16,7 +16,7 @@ public sealed record FilterV2Dto
/// The name of the filter
/// </summary>
public string? Name { get; set; }
public ICollection<FilterStatementDto> Statements { get; set; } = new List<FilterStatementDto>();
public ICollection<FilterStatementDto> Statements { get; set; } = [];
public FilterCombination Combination { get; set; } = FilterCombination.And;
public SortOptions? SortOptions { get; set; }

View file

@ -15,5 +15,9 @@ public enum MatchStateOption
public sealed record ManageMatchFilterDto
{
public MatchStateOption MatchStateOption { get; set; } = MatchStateOption.All;
/// <summary>
/// Library Type in int form. -1 indicates to ignore the field.
/// </summary>
public int LibraryType { get; set; } = -1;
public string SearchTerm { get; set; } = string.Empty;
}

View file

@ -0,0 +1,13 @@
namespace API.DTOs.Metadata.Browse;
public sealed record BrowseGenreDto : GenreTagDto
{
/// <summary>
/// Number of Series this Entity is on
/// </summary>
public int SeriesCount { get; set; }
/// <summary>
/// Number of Chapters this Entity is on
/// </summary>
public int ChapterCount { get; set; }
}

View file

@ -1,6 +1,6 @@
using API.DTOs.Person;
namespace API.DTOs;
namespace API.DTOs.Metadata.Browse;
/// <summary>
/// Used to browse writers and click in to see their series
@ -12,7 +12,7 @@ public class BrowsePersonDto : PersonDto
/// </summary>
public int SeriesCount { get; set; }
/// <summary>
/// Number or Issues this Person is the Writer for
/// Number of Issues this Person is the Writer for
/// </summary>
public int IssueCount { get; set; }
public int ChapterCount { get; set; }
}

View file

@ -0,0 +1,13 @@
namespace API.DTOs.Metadata.Browse;
public sealed record BrowseTagDto : TagDto
{
/// <summary>
/// Number of Series this Entity is on
/// </summary>
public int SeriesCount { get; set; }
/// <summary>
/// Number of Chapters this Entity is on
/// </summary>
public int ChapterCount { get; set; }
}

View file

@ -0,0 +1,27 @@
using System.Collections.Generic;
using API.DTOs.Filtering;
using API.DTOs.Filtering.v2;
using API.Entities.Enums;
namespace API.DTOs.Metadata.Browse.Requests;
#nullable enable
public sealed record BrowsePersonFilterDto
{
/// <summary>
/// Not used - For parity with Series Filter
/// </summary>
public int Id { get; set; }
/// <summary>
/// Not used - For parity with Series Filter
/// </summary>
public string? Name { get; set; }
public ICollection<PersonFilterStatementDto> Statements { get; set; } = [];
public FilterCombination Combination { get; set; } = FilterCombination.And;
public PersonSortOptions? SortOptions { get; set; }
/// <summary>
/// Limit the number of rows returned. Defaults to not applying a limit (aka 0)
/// </summary>
public int LimitTo { get; set; } = 0;
}

View file

@ -1,6 +1,6 @@
namespace API.DTOs.Metadata;
public sealed record GenreTagDto
public record GenreTagDto
{
public int Id { get; set; }
public required string Title { get; set; }

View file

@ -1,6 +1,6 @@
namespace API.DTOs.Metadata;
public sealed record TagDto
public record TagDto
{
public int Id { get; set; }
public required string Title { get; set; }

View file

@ -49,6 +49,11 @@ public sealed record ReadingListDto : IHasCoverImage
/// </summary>
public required AgeRating AgeRating { get; set; } = AgeRating.Unknown;
/// <summary>
/// Username of the User that owns (in the case of a promoted list)
/// </summary>
public string OwnerUserName { get; set; }
public void ResetColorScape()
{
PrimaryColor = string.Empty;

View file

@ -64,6 +64,9 @@ public sealed record UserReadingProfileDto
/// <inheritdoc cref="AppUserReadingProfile.WidthOverride"/>
public int? WidthOverride { get; set; }
/// <inheritdoc cref="AppUserReadingProfile.DisableWidthOverride"/>
public BreakPoint DisableWidthOverride { get; set; } = BreakPoint.Never;
#endregion
#region EpubReader