Move all appropriate DTOs to sealed records.

This commit is contained in:
Joseph Milazzo 2025-05-04 08:41:29 -05:00
parent bc41b0256e
commit 3ca72b0b20
199 changed files with 234 additions and 221 deletions

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()
{