Small UI changes (#3787)

This commit is contained in:
Joe Milazzo 2025-05-04 08:14:44 -06:00 committed by GitHub
parent 50a052e412
commit 5b8a643d82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
203 changed files with 369 additions and 446 deletions

View File

@ -2,15 +2,15 @@
namespace API.DTOs.Account;
public class AgeRestrictionDto
public sealed record AgeRestrictionDto
{
/// <summary>
/// The maximum age rating a user has access to. -1 if not applicable
/// </summary>
public required AgeRating AgeRating { get; set; } = AgeRating.NotApplicable;
public required AgeRating AgeRating { get; init; } = AgeRating.NotApplicable;
/// <summary>
/// Are Unknowns explicitly allowed against age rating
/// </summary>
/// <remarks>Unknown is always lowest and default age rating. Setting this to false will ensure Teen age rating applies and unknowns are still filtered</remarks>
public required bool IncludeUnknowns { get; set; } = false;
public required bool IncludeUnknowns { get; init; } = false;
}

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Account;
public class ConfirmEmailDto
public sealed record ConfirmEmailDto
{
[Required]
public string Email { get; set; } = default!;

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Account;
public class ConfirmEmailUpdateDto
public sealed record ConfirmEmailUpdateDto
{
[Required]
public string Email { get; set; } = default!;

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Account;
public class ConfirmMigrationEmailDto
public sealed record ConfirmMigrationEmailDto
{
public string Email { get; set; } = default!;
public string Token { get; set; } = default!;

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Account;
public class ConfirmPasswordResetDto
public sealed record ConfirmPasswordResetDto
{
[Required]
public string Email { get; set; } = default!;

View File

@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
namespace API.DTOs.Account;
public class InviteUserDto
public sealed record InviteUserDto
{
[Required]
public string Email { get; set; } = default!;

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Account;
public class InviteUserResponse
public sealed record InviteUserResponse
{
/// <summary>
/// Email link used to setup the user account

View File

@ -1,7 +1,7 @@
namespace API.DTOs.Account;
#nullable enable
public class LoginDto
public sealed record LoginDto
{
public string Username { get; init; } = default!;
public string Password { get; set; } = default!;

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Account;
public class MigrateUserEmailDto
public sealed record MigrateUserEmailDto
{
public string Email { get; set; } = default!;
public string Username { get; set; } = default!;

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Account;
public class ResetPasswordDto
public sealed record ResetPasswordDto
{
/// <summary>
/// The Username of the User

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Account;
public class TokenRequestDto
public sealed record TokenRequestDto
{
public string Token { get; init; } = default!;
public string RefreshToken { get; init; } = default!;

View File

@ -3,7 +3,7 @@ using API.Entities.Enums;
namespace API.DTOs.Account;
public class UpdateAgeRestrictionDto
public sealed record UpdateAgeRestrictionDto
{
[Required]
public AgeRating AgeRating { get; set; }

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Account;
public class UpdateEmailDto
public sealed record UpdateEmailDto
{
public string Email { get; set; } = default!;
public string Password { get; set; } = default!;

View File

@ -4,12 +4,16 @@ using System.ComponentModel.DataAnnotations;
namespace API.DTOs.Account;
#nullable enable
public record UpdateUserDto
public sealed record UpdateUserDto
{
/// <inheritdoc cref="API.Entities.AppUser.Id"/>
public int UserId { get; set; }
/// <inheritdoc cref="API.Entities.AppUser.UserName"/>
public string Username { get; set; } = default!;
/// <summary>
/// List of Roles to assign to user. If admin not present, Pleb will be applied.
/// If admin present, all libraries will be granted access and will ignore those from DTO.
/// </summary>
public IList<string> Roles { get; init; } = default!;
/// <summary>
/// A list of libraries to grant access to
@ -19,8 +23,6 @@ public record UpdateUserDto
/// An Age Rating which will limit the account to seeing everything equal to or below said rating.
/// </summary>
public AgeRestrictionDto AgeRestriction { get; init; } = default!;
/// <summary>
/// Email of the user
/// </summary>
/// <inheritdoc cref="API.Entities.AppUser.Email"/>
public string? Email { get; set; } = default!;
}

View File

@ -2,7 +2,7 @@
namespace API.DTOs;
public class BulkActionDto
public sealed record BulkActionDto
{
public List<int> Ids { get; set; }
/**

View File

@ -4,7 +4,7 @@ using API.DTOs.SeriesDetail;
namespace API.DTOs;
public class ChapterDetailPlusDto
public sealed record ChapterDetailPlusDto
{
public float Rating { get; set; }
public bool HasBeenRated { get; set; }

View File

@ -13,37 +13,24 @@ namespace API.DTOs;
/// </summary>
public class ChapterDto : IHasReadTimeEstimate, IHasCoverImage
{
/// <inheritdoc cref="API.Entities.Chapter.Id"/>
public int Id { get; init; }
/// <summary>
/// Range of chapters. Chapter 2-4 -> "2-4". Chapter 2 -> "2". If special, will be special name.
/// </summary>
/// <remarks>This can be something like 19.HU or Alpha as some comics are like this</remarks>
/// <inheritdoc cref="API.Entities.Chapter.Range"/>
public string Range { get; init; } = default!;
/// <summary>
/// Smallest number of the Range.
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.Number"/>
[Obsolete("Use MinNumber and MaxNumber instead")]
public string Number { get; init; } = default!;
/// <summary>
/// This may be 0 under the circumstance that the Issue is "Alpha" or other non-standard numbers.
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.MinNumber"/>
public float MinNumber { get; init; }
/// <inheritdoc cref="API.Entities.Chapter.MaxNumber"/>
public float MaxNumber { get; init; }
/// <summary>
/// The sorting order of the Chapter. Inherits from MinNumber, but can be overridden.
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.SortOrder"/>
public float SortOrder { get; set; }
/// <summary>
/// Total number of pages in all MangaFiles
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.Pages"/>
public int Pages { get; init; }
/// <summary>
/// If this Chapter contains files that could only be identified as Series or has Special Identifier from filename
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.IsSpecial"/>
public bool IsSpecial { get; init; }
/// <summary>
/// Used for books/specials to display custom title. For non-specials/books, will be set to <see cref="Range"/>
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.Title"/>
public string Title { get; set; } = default!;
/// <summary>
/// The files that represent this Chapter
@ -61,46 +48,25 @@ public class ChapterDto : IHasReadTimeEstimate, IHasCoverImage
/// The last time a chapter was read by current authenticated user
/// </summary>
public DateTime LastReadingProgress { get; set; }
/// <summary>
/// If the Cover Image is locked for this entity
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.CoverImageLocked"/>
public bool CoverImageLocked { get; set; }
/// <summary>
/// Volume Id this Chapter belongs to
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.VolumeId"/>
public int VolumeId { get; init; }
/// <summary>
/// When chapter was created
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.CreatedUtc"/>
public DateTime CreatedUtc { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.LastModifiedUtc"/>
public DateTime LastModifiedUtc { get; set; }
/// <summary>
/// When chapter was created in local server time
/// </summary>
/// <remarks>This is required for Tachiyomi Extension</remarks>
/// <inheritdoc cref="API.Entities.Chapter.Created"/>
public DateTime Created { get; set; }
/// <summary>
/// When the chapter was released.
/// </summary>
/// <remarks>Metadata field</remarks>
/// <inheritdoc cref="API.Entities.Chapter.ReleaseDate"/>
public DateTime ReleaseDate { get; init; }
/// <summary>
/// Title of the Chapter/Issue
/// </summary>
/// <remarks>Metadata field</remarks>
/// <inheritdoc cref="API.Entities.Chapter.TitleName"/>
public string TitleName { get; set; } = default!;
/// <summary>
/// Summary of the Chapter
/// </summary>
/// <remarks>This is not set normally, only for Series Detail</remarks>
/// <inheritdoc cref="API.Entities.Chapter.Summary"/>
public string Summary { get; init; } = default!;
/// <summary>
/// Age Rating for the issue/chapter
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.AgeRating"/>
public AgeRating AgeRating { get; init; }
/// <summary>
/// Total words in a Chapter (books only)
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.WordCount"/>
public long WordCount { get; set; } = 0L;
/// <summary>
/// Formatted Volume title ie) Volume 2.
@ -113,14 +79,9 @@ public class ChapterDto : IHasReadTimeEstimate, IHasCoverImage
public int MaxHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.AvgHoursToRead"/>
public float AvgHoursToRead { get; set; }
/// <summary>
/// Comma-separated link of urls to external services that have some relation to the Chapter
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.WebLinks"/>
public string WebLinks { get; set; }
/// <summary>
/// ISBN-13 (usually) of the Chapter
/// </summary>
/// <remarks>This is guaranteed to be Valid</remarks>
/// <inheritdoc cref="API.Entities.Chapter.ISBN"/>
public string ISBN { get; set; }
#region Metadata
@ -146,51 +107,60 @@ public class ChapterDto : IHasReadTimeEstimate, IHasCoverImage
/// </summary>
public ICollection<TagDto> Tags { get; set; } = new List<TagDto>();
public PublicationStatus PublicationStatus { get; set; }
/// <summary>
/// Language for the Chapter/Issue
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.Language"/>
public string? Language { get; set; }
/// <summary>
/// Number in the TotalCount of issues
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.Count"/>
public int Count { get; set; }
/// <summary>
/// Total number of issues for the series
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.TotalCount"/>
public int TotalCount { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.LanguageLocked"/>
public bool LanguageLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.SummaryLocked"/>
public bool SummaryLocked { get; set; }
/// <summary>
/// Locked by user so metadata updates from scan loop will not override AgeRating
/// </summary>
/// <inheritdoc cref="API.Entities.Chapter.AgeRatingLocked"/>
public bool AgeRatingLocked { get; set; }
/// <summary>
/// Locked by user so metadata updates from scan loop will not override PublicationStatus
/// </summary>
public bool PublicationStatusLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.GenresLocked"/>
public bool GenresLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.TagsLocked"/>
public bool TagsLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.WriterLocked"/>
public bool WriterLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.CharacterLocked"/>
public bool CharacterLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.ColoristLocked"/>
public bool ColoristLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.EditorLocked"/>
public bool EditorLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.InkerLocked"/>
public bool InkerLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.ImprintLocked"/>
public bool ImprintLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.LettererLocked"/>
public bool LettererLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.PencillerLocked"/>
public bool PencillerLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.PublisherLocked"/>
public bool PublisherLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.TranslatorLocked"/>
public bool TranslatorLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.TeamLocked"/>
public bool TeamLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.LocationLocked"/>
public bool LocationLocked { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.CoverArtistLocked"/>
public bool CoverArtistLocked { get; set; }
public bool ReleaseYearLocked { get; set; }
#endregion
public string CoverImage { get; set; }
public string PrimaryColor { get; set; } = string.Empty;
public string SecondaryColor { get; set; } = string.Empty;
/// <inheritdoc cref="API.Entities.Chapter.CoverImage"/>
public string? CoverImage { get; set; }
/// <inheritdoc cref="API.Entities.Chapter.PrimaryColor"/>
public string? PrimaryColor { get; set; } = string.Empty;
/// <inheritdoc cref="API.Entities.Chapter.SecondaryColor"/>
public string? SecondaryColor { get; set; } = string.Empty;
public void ResetColorScape()
{

View File

@ -6,52 +6,52 @@ using API.Services.Plus;
namespace API.DTOs.Collection;
#nullable enable
public class AppUserCollectionDto : IHasCoverImage
public sealed record AppUserCollectionDto : IHasCoverImage
{
public int Id { get; init; }
public string Title { get; set; } = default!;
public string? Summary { get; set; } = default!;
public bool Promoted { get; set; }
public AgeRating AgeRating { get; set; }
public string Title { get; init; } = default!;
public string? Summary { get; init; } = default!;
public bool Promoted { get; init; }
public AgeRating AgeRating { get; init; }
/// <summary>
/// This is used to tell the UI if it should request a Cover Image or not. If null or empty, it has not been set.
/// </summary>
public string? CoverImage { get; set; } = string.Empty;
public string PrimaryColor { get; set; } = string.Empty;
public string SecondaryColor { get; set; } = string.Empty;
public bool CoverImageLocked { get; set; }
public string? PrimaryColor { get; set; } = string.Empty;
public string? SecondaryColor { get; set; } = string.Empty;
public bool CoverImageLocked { get; init; }
/// <summary>
/// Number of Series in the Collection
/// </summary>
public int ItemCount { get; set; }
public int ItemCount { get; init; }
/// <summary>
/// Owner of the Collection
/// </summary>
public string? Owner { get; set; }
public string? Owner { get; init; }
/// <summary>
/// Last time Kavita Synced the Collection with an upstream source (for non Kavita sourced collections)
/// </summary>
public DateTime LastSyncUtc { get; set; }
public DateTime LastSyncUtc { get; init; }
/// <summary>
/// Who created/manages the list. Non-Kavita lists are not editable by the user, except to promote
/// </summary>
public ScrobbleProvider Source { get; set; } = ScrobbleProvider.Kavita;
public ScrobbleProvider Source { get; init; } = ScrobbleProvider.Kavita;
/// <summary>
/// For Non-Kavita sourced collections, the url to sync from
/// </summary>
public string? SourceUrl { get; set; }
public string? SourceUrl { get; init; }
/// <summary>
/// Total number of items as of the last sync. Not applicable for Kavita managed collections.
/// </summary>
public int TotalSourceCount { get; set; }
public int TotalSourceCount { get; init; }
/// <summary>
/// A <br/> separated string of all missing series
/// </summary>
public string? MissingSeriesFromSource { get; set; }
public string? MissingSeriesFromSource { get; init; }
public void ResetColorScape()
{

View File

@ -2,7 +2,7 @@
namespace API.DTOs.CollectionTags;
public class CollectionTagBulkAddDto
public sealed record CollectionTagBulkAddDto
{
/// <summary>
/// Collection Tag Id

View File

@ -3,15 +3,21 @@
namespace API.DTOs.CollectionTags;
[Obsolete("Use AppUserCollectionDto")]
public class CollectionTagDto
public sealed record CollectionTagDto
{
/// <inheritdoc cref="API.Entities.CollectionTag.Id"/>
public int Id { get; set; }
/// <inheritdoc cref="API.Entities.CollectionTag.Title"/>
public string Title { get; set; } = default!;
/// <inheritdoc cref="API.Entities.CollectionTag.Summary"/>
public string Summary { get; set; } = default!;
/// <inheritdoc cref="API.Entities.CollectionTag.Promoted"/>
public bool Promoted { get; set; }
/// <summary>
/// The cover image string. This is used on Frontend to show or hide the Cover Image
/// </summary>
/// <inheritdoc cref="API.Entities.CollectionTag.CoverImage"/>
public string CoverImage { get; set; } = default!;
/// <inheritdoc cref="API.Entities.CollectionTag.CoverImageLocked"/>
public bool CoverImageLocked { get; set; }
}

View File

@ -4,7 +4,7 @@ using API.DTOs.Collection;
namespace API.DTOs.CollectionTags;
public class UpdateSeriesForTagDto
public sealed record UpdateSeriesForTagDto
{
public AppUserCollectionDto Tag { get; init; } = default!;
public IEnumerable<int> SeriesIdsToRemove { get; init; } = default!;

View File

@ -4,7 +4,7 @@
/// <summary>
/// A primary and secondary color
/// </summary>
public class ColorScape
public sealed record ColorScape
{
public required string? Primary { get; set; }
public required string? Secondary { get; set; }

View File

@ -2,7 +2,7 @@
namespace API.DTOs;
public class CopySettingsFromLibraryDto
public sealed record CopySettingsFromLibraryDto
{
public int SourceLibraryId { get; set; }
public List<int> TargetLibraryIds { get; set; }

View File

@ -3,7 +3,7 @@ using YamlDotNet.Serialization;
namespace API.DTOs.CoverDb;
public class CoverDbAuthor
public sealed record CoverDbAuthor
{
[YamlMember(Alias = "name", ApplyNamingConventions = false)]
public string Name { get; set; }

View File

@ -3,7 +3,7 @@ using YamlDotNet.Serialization;
namespace API.DTOs.CoverDb;
public class CoverDbPeople
public sealed record CoverDbPeople
{
[YamlMember(Alias = "people", ApplyNamingConventions = false)]
public List<CoverDbAuthor> People { get; set; } = new List<CoverDbAuthor>();

View File

@ -3,7 +3,7 @@
namespace API.DTOs.CoverDb;
#nullable enable
public class CoverDbPersonIds
public sealed record CoverDbPersonIds
{
[YamlMember(Alias = "hardcover_id", ApplyNamingConventions = false)]
public string? HardcoverId { get; set; } = null;

View File

@ -4,7 +4,7 @@ using API.Entities.Enums;
namespace API.DTOs.Dashboard;
public class DashboardStreamDto
public sealed record DashboardStreamDto
{
public int Id { get; set; }
public required string Name { get; set; }

View File

@ -5,7 +5,7 @@ namespace API.DTOs.Dashboard;
/// <summary>
/// This is a representation of a Series with some amount of underlying files within it. This is used for Recently Updated Series section
/// </summary>
public class GroupedSeriesDto
public sealed record GroupedSeriesDto
{
public string SeriesName { get; set; } = default!;
public int SeriesId { get; set; }

View File

@ -6,7 +6,7 @@ namespace API.DTOs.Dashboard;
/// <summary>
/// A mesh of data for Recently added volume/chapters
/// </summary>
public class RecentlyAddedItemDto
public sealed record RecentlyAddedItemDto
{
public string SeriesName { get; set; } = default!;
public int SeriesId { get; set; }

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Dashboard;
public class SmartFilterDto
public sealed record SmartFilterDto
{
public int Id { get; set; }
public required string Name { get; set; }

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Dashboard;
public class UpdateDashboardStreamPositionDto
public sealed record UpdateDashboardStreamPositionDto
{
public int FromPosition { get; set; }
public int ToPosition { get; set; }

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Dashboard;
public class UpdateStreamPositionDto
public sealed record UpdateStreamPositionDto
{
public int FromPosition { get; set; }
public int ToPosition { get; set; }

View File

@ -2,7 +2,7 @@
namespace API.DTOs;
public class DeleteChaptersDto
public sealed record DeleteChaptersDto
{
public IList<int> ChapterIds { get; set; } = default!;
}

View File

@ -2,7 +2,7 @@
namespace API.DTOs;
public class DeleteSeriesDto
public sealed record DeleteSeriesDto
{
public IList<int> SeriesIds { get; set; } = default!;
}

View File

@ -3,7 +3,7 @@ using API.Entities.Enums.Device;
namespace API.DTOs.Device;
public class CreateDeviceDto
public sealed record CreateDeviceDto
{
[Required]
public string Name { get; set; } = default!;

View File

@ -6,7 +6,7 @@ namespace API.DTOs.Device;
/// <summary>
/// A Device is an entity that can receive data from Kavita (kindle)
/// </summary>
public class DeviceDto
public sealed record DeviceDto
{
/// <summary>
/// The device Id

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Device;
public class SendSeriesToDeviceDto
public sealed record SendSeriesToDeviceDto
{
public int DeviceId { get; set; }
public int SeriesId { get; set; }

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Device;
public class SendToDeviceDto
public sealed record SendToDeviceDto
{
public int DeviceId { get; set; }
public IReadOnlyList<int> ChapterIds { get; set; } = default!;

View File

@ -3,7 +3,7 @@ using API.Entities.Enums.Device;
namespace API.DTOs.Device;
public class UpdateDeviceDto
public sealed record UpdateDeviceDto
{
[Required]
public int Id { get; set; }

View File

@ -4,7 +4,7 @@ using API.DTOs.Reader;
namespace API.DTOs.Downloads;
public class DownloadBookmarkDto
public sealed record DownloadBookmarkDto
{
[Required]
public IEnumerable<BookmarkDto> Bookmarks { get; set; } = default!;

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Email;
public class ConfirmationEmailDto
public sealed record ConfirmationEmailDto
{
public string InvitingUser { get; init; } = default!;
public string EmailAddress { get; init; } = default!;

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Email;
public class EmailHistoryDto
public sealed record EmailHistoryDto
{
public long Id { get; set; }
public bool Sent { get; set; }

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Email;
public class EmailMigrationDto
public sealed record EmailMigrationDto
{
public string EmailAddress { get; init; } = default!;
public string Username { get; init; } = default!;

View File

@ -3,7 +3,7 @@
/// <summary>
/// Represents if Test Email Service URL was successful or not and if any error occured
/// </summary>
public class EmailTestResultDto
public sealed record EmailTestResultDto
{
public bool Successful { get; set; }
public string ErrorMessage { get; set; } = default!;

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Email;
public class PasswordResetEmailDto
public sealed record PasswordResetEmailDto
{
public string EmailAddress { get; init; } = default!;
public string ServerConfirmationLink { get; init; } = default!;

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Email;
public class SendToDto
public sealed record SendToDto
{
public string DestinationEmail { get; set; } = default!;
public IEnumerable<string> FilePaths { get; set; } = default!;

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Email;
public class TestEmailDto
public sealed record TestEmailDto
{
public string Url { get; set; } = default!;
}

View File

@ -5,7 +5,7 @@ using API.Entities.Enums;
namespace API.DTOs.Filtering;
#nullable enable
public class FilterDto
public sealed record FilterDto
{
/// <summary>
/// The type of Formats you want to be returned. An empty list will return all formats back

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Filtering;
public class LanguageDto
public sealed record LanguageDto
{
public required string IsoCode { get; set; }
public required string Title { get; set; }

View File

@ -4,7 +4,7 @@
/// <summary>
/// Represents a range between two int/float/double
/// </summary>
public class Range<T>
public sealed record Range<T>
{
public T? Min { get; init; }
public T? Max { get; init; }

View File

@ -3,7 +3,7 @@
/// <summary>
/// Represents the Reading Status. This is a flag and allows multiple statues
/// </summary>
public class ReadStatus
public sealed record ReadStatus
{
public bool NotRead { get; set; } = true;
public bool InProgress { get; set; } = true;

View File

@ -3,7 +3,7 @@
/// <summary>
/// Sorting Options for a query
/// </summary>
public class SortOptions
public sealed record SortOptions
{
public SortField SortField { get; set; }
public bool IsAscending { get; set; } = true;

View File

@ -3,7 +3,7 @@
/// <summary>
/// For requesting an encoded filter to be decoded
/// </summary>
public class DecodeFilterDto
public sealed record DecodeFilterDto
{
public string EncodedFilter { get; set; }
}

View File

@ -1,6 +1,6 @@
namespace API.DTOs.Filtering.v2;
public class FilterStatementDto
public sealed record FilterStatementDto
{
public FilterComparison Comparison { get; set; }
public FilterField Field { get; set; }

View File

@ -6,7 +6,7 @@ namespace API.DTOs.Filtering.v2;
/// <summary>
/// Metadata filtering for v2 API only
/// </summary>
public class FilterV2Dto
public sealed record FilterV2Dto
{
/// <summary>
/// Not used in the UI.

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Jobs;
public class JobDto
public sealed record JobDto
{
/// <summary>
/// Job Id

View File

@ -3,7 +3,7 @@
/// <summary>
/// Represents an individual button in a Jump Bar
/// </summary>
public class JumpKeyDto
public sealed record JumpKeyDto
{
/// <summary>
/// Number of items in this Key

View File

@ -1,6 +1,6 @@
namespace API.DTOs;
public class KavitaLocale
public sealed record KavitaLocale
{
public string FileName { get; set; } // Key
public string RenderName { get; set; }

View File

@ -1,6 +1,6 @@
namespace API.DTOs.KavitaPlus.Account;
public class AniListUpdateDto
public sealed record AniListUpdateDto
{
public string Token { get; set; }
}

View File

@ -5,7 +5,7 @@ namespace API.DTOs.KavitaPlus.Account;
/// <summary>
/// Represents information around a user's tokens and their status
/// </summary>
public class UserTokenInfo
public sealed record UserTokenInfo
{
public int UserId { get; set; }
public string Username { get; set; }

View File

@ -6,7 +6,7 @@ namespace API.DTOs.KavitaPlus.ExternalMetadata;
/// <summary>
/// Used for matching and fetching metadata on a series
/// </summary>
internal class ExternalMetadataIdsDto
internal sealed record ExternalMetadataIdsDto
{
public long? MalId { get; set; }
public int? AniListId { get; set; }

View File

@ -4,7 +4,7 @@ using API.DTOs.Scrobbling;
namespace API.DTOs.KavitaPlus.ExternalMetadata;
#nullable enable
internal class MatchSeriesRequestDto
internal sealed record MatchSeriesRequestDto
{
public string SeriesName { get; set; }
public ICollection<string> AlternativeNames { get; set; }

View File

@ -1,11 +1,12 @@
using System.Collections.Generic;
using API.DTOs.KavitaPlus.Metadata;
using API.DTOs.Recommendation;
using API.DTOs.Scrobbling;
using API.DTOs.SeriesDetail;
namespace API.DTOs.KavitaPlus.ExternalMetadata;
internal class SeriesDetailPlusApiDto
internal sealed record SeriesDetailPlusApiDto
{
public IEnumerable<MediaRecommendationDto> Recommendations { get; set; }
public IEnumerable<UserReviewDto> Reviews { get; set; }

View File

@ -1,7 +1,7 @@
namespace API.DTOs.KavitaPlus.License;
#nullable enable
public class EncryptLicenseDto
public sealed record EncryptLicenseDto
{
public required string License { get; set; }
public required string InstallId { get; set; }

View File

@ -2,7 +2,7 @@
namespace API.DTOs.KavitaPlus.License;
public class LicenseInfoDto
public sealed record LicenseInfoDto
{
/// <summary>
/// If cancelled, will represent cancellation date. If not, will represent repayment date

View File

@ -1,6 +1,6 @@
namespace API.DTOs.KavitaPlus.License;
public class LicenseValidDto
public sealed record LicenseValidDto
{
public required string License { get; set; }
public required string InstallId { get; set; }

View File

@ -1,6 +1,6 @@
namespace API.DTOs.KavitaPlus.License;
public class ResetLicenseDto
public sealed record ResetLicenseDto
{
public required string License { get; set; }
public required string InstallId { get; set; }

View File

@ -1,7 +1,7 @@
namespace API.DTOs.KavitaPlus.License;
#nullable enable
public class UpdateLicenseDto
public sealed record UpdateLicenseDto
{
/// <summary>
/// License Key received from Kavita+

View File

@ -12,7 +12,7 @@ public enum MatchStateOption
DontMatch = 4
}
public class ManageMatchFilterDto
public sealed record ManageMatchFilterDto
{
public MatchStateOption MatchStateOption { get; set; } = MatchStateOption.All;
public string SearchTerm { get; set; } = string.Empty;

View File

@ -2,7 +2,7 @@
namespace API.DTOs.KavitaPlus.Manage;
public class ManageMatchSeriesDto
public sealed record ManageMatchSeriesDto
{
public SeriesDto Series { get; set; }
public bool IsMatched { get; set; }

View File

@ -7,7 +7,7 @@ namespace API.DTOs.KavitaPlus.Metadata;
/// <summary>
/// Information about an individual issue/chapter/book from Kavita+
/// </summary>
public class ExternalChapterDto
public sealed record ExternalChapterDto
{
public string Title { get; set; }

View File

@ -1,16 +1,16 @@
using System;
using System.Collections.Generic;
using API.DTOs.KavitaPlus.Metadata;
using API.DTOs.Recommendation;
using API.DTOs.Scrobbling;
using API.Services.Plus;
namespace API.DTOs.Recommendation;
namespace API.DTOs.KavitaPlus.Metadata;
#nullable enable
/// <summary>
/// This is AniListSeries
/// </summary>
public class ExternalSeriesDetailDto
public sealed record ExternalSeriesDetailDto
{
public string Name { get; set; }
public int? AniListId { get; set; }

View File

@ -2,7 +2,7 @@
namespace API.DTOs.KavitaPlus.Metadata;
public class MetadataFieldMappingDto
public sealed record MetadataFieldMappingDto
{
public int Id { get; set; }
public MetadataFieldType SourceType { get; set; }

View File

@ -7,7 +7,7 @@ using NotImplementedException = System.NotImplementedException;
namespace API.DTOs.KavitaPlus.Metadata;
public class MetadataSettingsDto
public sealed record MetadataSettingsDto
{
/// <summary>
/// If writing any sort of metadata from upstream (AniList, Hardcover) source is allowed

View File

@ -9,7 +9,7 @@ public enum CharacterRole
}
public class SeriesCharacter
public sealed record SeriesCharacter
{
public string Name { get; set; }
public required string Description { get; set; }

View File

@ -5,7 +5,7 @@ using API.Services.Plus;
namespace API.DTOs.KavitaPlus.Metadata;
public class ALMediaTitle
public sealed record ALMediaTitle
{
public string? EnglishTitle { get; set; }
public string RomajiTitle { get; set; }
@ -13,7 +13,7 @@ public class ALMediaTitle
public string PreferredTitle { get; set; }
}
public class SeriesRelationship
public sealed record SeriesRelationship
{
public int AniListId { get; set; }
public int? MalId { get; set; }

View File

@ -1,12 +1,11 @@
using System;
using System.Collections;
using System.Collections.Generic;
using API.Entities.Enums;
namespace API.DTOs;
#nullable enable
public class LibraryDto
public sealed record LibraryDto
{
public int Id { get; init; }
public string? Name { get; init; }

View File

@ -4,7 +4,7 @@ using API.Entities.Enums;
namespace API.DTOs;
#nullable enable
public class MangaFileDto
public sealed record MangaFileDto
{
public int Id { get; init; }
/// <summary>

View File

@ -2,7 +2,7 @@
namespace API.DTOs.MediaErrors;
public class MediaErrorDto
public sealed record MediaErrorDto
{
/// <summary>
/// Format Type (RAR, ZIP, 7Zip, Epub, PDF)

View File

@ -8,7 +8,7 @@ namespace API.DTOs;
/// <summary>
/// Represents a member of a Kavita server.
/// </summary>
public class MemberDto
public sealed record MemberDto
{
public int Id { get; init; }
public string? Username { get; init; }

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Metadata;
public class AgeRatingDto
public sealed record AgeRatingDto
{
public AgeRating Value { get; set; }
public required string Title { get; set; }

View File

@ -9,7 +9,7 @@ namespace API.DTOs.Metadata;
/// Exclusively metadata about a given chapter
/// </summary>
[Obsolete("Will not be maintained as of v0.8.1")]
public class ChapterMetadataDto
public sealed record ChapterMetadataDto
{
public int Id { get; set; }
public int ChapterId { get; set; }

View File

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

View File

@ -1,8 +1,9 @@
using API.DTOs.KavitaPlus.Metadata;
using API.DTOs.Recommendation;
namespace API.DTOs.Metadata.Matching;
public class ExternalSeriesMatchDto
public sealed record ExternalSeriesMatchDto
{
public ExternalSeriesDetailDto Series { get; set; }
public float MatchRating { get; set; }

View File

@ -3,7 +3,7 @@ namespace API.DTOs.Metadata.Matching;
/// <summary>
/// Used for matching a series with Kavita+ for metadata and scrobbling
/// </summary>
public class MatchSeriesDto
public sealed record MatchSeriesDto
{
/// <summary>
/// When set, Kavita will stop attempting to match this series and will not perform any scrobbling

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Metadata;
public class PublicationStatusDto
public sealed record PublicationStatusDto
{
public PublicationStatus Value { get; set; }
public required string Title { get; set; }

View File

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

View File

@ -4,11 +4,13 @@ using System.Xml.Serialization;
namespace API.DTOs.OPDS;
// TODO: OPDS Dtos are internal state, shouldn't be in DTO directory
/// <summary>
///
/// </summary>
[XmlRoot("feed", Namespace = "http://www.w3.org/2005/Atom")]
public class Feed
public sealed record Feed
{
[XmlElement("updated")]
public string Updated { get; init; } = DateTime.UtcNow.ToString("s");

View File

@ -2,7 +2,7 @@
namespace API.DTOs.OPDS;
public class FeedAuthor
public sealed record FeedAuthor
{
[XmlElement("name")]
public string Name { get; set; }

View File

@ -2,7 +2,7 @@
namespace API.DTOs.OPDS;
public class FeedCategory
public sealed record FeedCategory
{
[XmlAttribute("scheme")]
public string Scheme { get; } = "http://www.bisg.org/standards/bisac_subject/index.html";

View File

@ -5,7 +5,7 @@ using System.Xml.Serialization;
namespace API.DTOs.OPDS;
#nullable enable
public class FeedEntry
public sealed record FeedEntry
{
[XmlElement("updated")]
public string Updated { get; init; } = DateTime.UtcNow.ToString("s");

View File

@ -2,7 +2,7 @@
namespace API.DTOs.OPDS;
public class FeedEntryContent
public sealed record FeedEntryContent
{
[XmlAttribute("type")]
public string Type = "text";

View File

@ -3,7 +3,7 @@ using System.Xml.Serialization;
namespace API.DTOs.OPDS;
public class FeedLink
public sealed record FeedLink
{
[XmlIgnore]
public bool IsPageStream { get; set; }

View File

@ -3,7 +3,7 @@
namespace API.DTOs.OPDS;
[XmlRoot("OpenSearchDescription", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public class OpenSearchDescription
public sealed record OpenSearchDescription
{
/// <summary>
/// Contains a brief human-readable title that identifies this search engine.

View File

@ -2,7 +2,7 @@
namespace API.DTOs.OPDS;
public class SearchLink
public sealed record SearchLink
{
[XmlAttribute("type")]
public string Type { get; set; } = default!;

View File

@ -3,7 +3,7 @@
namespace API.DTOs;
#nullable enable
public class UpdatePersonDto
public sealed record UpdatePersonDto
{
[Required]
public int Id { get; init; }

View File

@ -5,7 +5,7 @@ namespace API.DTOs.Progress;
/// <summary>
/// A full progress Record from the DB (not all data, only what's needed for API)
/// </summary>
public class FullProgressDto
public sealed record FullProgressDto
{
public int Id { get; set; }
public int ChapterId { get; set; }

View File

@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
namespace API.DTOs.Progress;
#nullable enable
public class ProgressDto
public sealed record ProgressDto
{
[Required]
public int VolumeId { get; set; }

View File

@ -1,14 +1,18 @@
using API.Entities.Enums;
using API.Entities;
using API.Entities.Enums;
using API.Entities.Metadata;
using API.Services.Plus;
namespace API.DTOs;
#nullable enable
public class RatingDto
public sealed record RatingDto
{
public int AverageScore { get; set; }
public int FavoriteCount { get; set; }
public ScrobbleProvider Provider { get; set; }
/// <inheritdoc cref="ExternalRating.Authority"/>
public RatingAuthority Authority { get; set; } = RatingAuthority.User;
public string? ProviderUrl { get; set; }
}

View File

@ -2,7 +2,7 @@
namespace API.DTOs.Reader;
public class BookChapterItem
public sealed record BookChapterItem
{
/// <summary>
/// Name of the Chapter

Some files were not shown because too many files have changed in this diff Show More