mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-23 15:30:34 -04:00
* Introduced a new claim on the Token to get UserId as well as Username, thus allowing for many places of reduced DB calls. All users will need to reauthenticate. Introduced UTC Dates throughout the application, they are not exposed in all DTOs, that will come later when we fully switch over. For now, Utc dates will be updated along side timezone specific dates. Refactored get-progress/progress api to be 50% faster by reducing how much data is loaded from the query. * Speed up the following apis: collection/search, download/bookmarks, reader/bookmark-info, recommended/quick-reads, recommended/quick-catchup-reads, recommended/highly-rated, recommended/more-in, recommended/rediscover, want-to-read/ * Added a migration to sync all dates with their new UTC counterpart. * Added LastReadingProgressUtc onto ChapterDto for some browsing apis, but not all. Added LastReadingProgressUtc to reading list items. Refactored the migration to run raw SQL which is much faster. * Added LastReadingProgressUtc onto ChapterDto for some browsing apis, but not all. Added LastReadingProgressUtc to reading list items. Refactored the migration to run raw SQL which is much faster. * Fixed the unit tests * Fixed an issue with auto mapper which was causing progress page number to not get sent to UI * series/volume has chapter last reading progress * Added filesize and library name on reading list item dto for CDisplayEx. * Some minor code cleanup * Forgot to fill a field
129 lines
4.5 KiB
C#
129 lines
4.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using API.Entities.Enums;
|
|
using API.Entities.Interfaces;
|
|
using API.Entities.Metadata;
|
|
|
|
namespace API.Entities;
|
|
|
|
public class Series : IEntityDate, IHasReadTimeEstimate
|
|
{
|
|
public int Id { get; set; }
|
|
/// <summary>
|
|
/// The UI visible Name of the Series. This may or may not be the same as the OriginalName
|
|
/// </summary>
|
|
public string Name { get; set; }
|
|
/// <summary>
|
|
/// Used internally for name matching. <see cref="Services.Tasks.Scanner.Parser.Parser.Normalize"/>
|
|
/// </summary>
|
|
public string NormalizedName { get; set; }
|
|
/// <summary>
|
|
/// Used internally for localized name matching. <see cref="Services.Tasks.Scanner.Parser.Parser.Normalize"/>
|
|
/// </summary>
|
|
public string NormalizedLocalizedName { get; set; }
|
|
/// <summary>
|
|
/// The name used to sort the Series. By default, will be the same as Name.
|
|
/// </summary>
|
|
public string SortName { get; set; }
|
|
/// <summary>
|
|
/// Name in original language (Japanese for Manga). By default, will be same as Name.
|
|
/// </summary>
|
|
public string LocalizedName { get; set; }
|
|
/// <summary>
|
|
/// Original Name on disk. Not exposed to UI.
|
|
/// </summary>
|
|
public string OriginalName { get; set; }
|
|
/// <summary>
|
|
/// Time of creation
|
|
/// </summary>
|
|
public DateTime Created { get; set; }
|
|
/// <summary>
|
|
/// Whenever a modification occurs. Ie) New volumes, removed volumes, title update, etc
|
|
/// </summary>
|
|
public DateTime LastModified { get; set; }
|
|
|
|
public DateTime CreatedUtc { get; set; }
|
|
public DateTime LastModifiedUtc { get; set; }
|
|
|
|
/// <summary>
|
|
/// Absolute path to the (managed) image file
|
|
/// </summary>
|
|
/// <remarks>The file is managed internally to Kavita's APPDIR</remarks>
|
|
public string CoverImage { get; set; }
|
|
/// <summary>
|
|
/// Denotes if the CoverImage has been overridden by the user. If so, it will not be updated during normal scan operations.
|
|
/// </summary>
|
|
public bool CoverImageLocked { get; set; }
|
|
/// <summary>
|
|
/// Sum of all Volume page counts
|
|
/// </summary>
|
|
public int Pages { get; set; }
|
|
/// <summary>
|
|
/// Highest path (that is under library root) that contains the series.
|
|
/// </summary>
|
|
/// <remarks><see cref="Services.Tasks.Scanner.Parser.Parser.NormalizePath"/> must be used before setting</remarks>
|
|
public string FolderPath { get; set; }
|
|
/// <summary>
|
|
/// Last time the folder was scanned
|
|
/// </summary>
|
|
public DateTime LastFolderScanned { get; set; }
|
|
/// <summary>
|
|
/// Last time the folder was scanned in Utc
|
|
/// </summary>
|
|
public DateTime LastFolderScannedUtc { get; set; }
|
|
/// <summary>
|
|
/// The type of all the files attached to this series
|
|
/// </summary>
|
|
public MangaFormat Format { get; set; } = MangaFormat.Unknown;
|
|
|
|
public bool NameLocked { get; set; }
|
|
public bool SortNameLocked { get; set; }
|
|
public bool LocalizedNameLocked { get; set; }
|
|
|
|
/// <summary>
|
|
/// When a Chapter was last added onto the Series
|
|
/// </summary>
|
|
public DateTime LastChapterAdded { get; set; }
|
|
public DateTime LastChapterAddedUtc { get; set; }
|
|
|
|
/// <summary>
|
|
/// Total Word count of all chapters in this chapter.
|
|
/// </summary>
|
|
/// <remarks>Word Count is only available from EPUB files</remarks>
|
|
public long WordCount { get; set; }
|
|
|
|
public int MinHoursToRead { get; set; }
|
|
public int MaxHoursToRead { get; set; }
|
|
public int AvgHoursToRead { get; set; }
|
|
|
|
public SeriesMetadata Metadata { get; set; }
|
|
|
|
public ICollection<AppUserRating> Ratings { get; set; } = new List<AppUserRating>();
|
|
public ICollection<AppUserProgress> Progress { get; set; } = new List<AppUserProgress>();
|
|
|
|
/// <summary>
|
|
/// Relations to other Series, like Sequels, Prequels, etc
|
|
/// </summary>
|
|
/// <remarks>1 to Many relationship</remarks>
|
|
public virtual ICollection<SeriesRelation> Relations { get; set; } = new List<SeriesRelation>();
|
|
public virtual ICollection<SeriesRelation> RelationOf { get; set; } = new List<SeriesRelation>();
|
|
|
|
|
|
// Relationships
|
|
public List<Volume> Volumes { get; set; }
|
|
public Library Library { get; set; }
|
|
public int LibraryId { get; set; }
|
|
|
|
public void UpdateLastFolderScanned()
|
|
{
|
|
LastFolderScanned = DateTime.Now;
|
|
LastFolderScannedUtc = DateTime.UtcNow;
|
|
}
|
|
|
|
public void UpdateLastChapterAdded()
|
|
{
|
|
LastChapterAdded = DateTime.Now;
|
|
LastChapterAddedUtc = DateTime.UtcNow;
|
|
}
|
|
}
|