using System; using System.Collections.Generic; using API.Entities; using API.Entities.Interfaces; using API.Extensions; using API.Services.Tasks.Scanner.Parser; namespace API.DTOs; public sealed record VolumeDto : IHasReadTimeEstimate, IHasCoverImage { /// public int Id { get; set; } /// public float MinNumber { get; set; } /// public float MaxNumber { get; set; } /// public string Name { get; set; } = default!; /// /// This will map to MinNumber. Number was removed in v0.7.13.8/v0.7.14 /// [Obsolete("Use MinNumber")] public int Number { get; set; } public int Pages { get; set; } public int PagesRead { get; set; } /// public DateTime LastModifiedUtc { get; set; } /// public DateTime CreatedUtc { get; set; } /// /// When chapter was created in local server time /// /// This is required for Tachiyomi Extension /// public DateTime Created { get; set; } /// /// When chapter was last modified in local server time /// /// This is required for Tachiyomi Extension /// public DateTime LastModified { get; set; } public int SeriesId { get; set; } public ICollection Chapters { get; set; } = new List(); /// public int MinHoursToRead { get; set; } /// public int MaxHoursToRead { get; set; } /// public float AvgHoursToRead { get; set; } public long WordCount { get; set; } /// /// Is this a loose leaf volume /// /// public bool IsLooseLeaf() { return MinNumber.Is(Parser.LooseLeafVolumeNumber); } /// /// Does this volume hold only specials /// /// public bool IsSpecial() { return MinNumber.Is(Parser.SpecialVolumeNumber); } /// public string CoverImage { get; set; } /// private bool CoverImageLocked { get; set; } /// public string? PrimaryColor { get; set; } = string.Empty; /// public string? SecondaryColor { get; set; } = string.Empty; public void ResetColorScape() { PrimaryColor = string.Empty; SecondaryColor = string.Empty; } }