Refactored ScanLibrary to produce page numbers on the Manga File, Format and to update existing series/volumes rather than always create new entries.

This commit is contained in:
Joseph Milazzo 2021-01-09 15:27:04 -06:00
parent 6b4617bab3
commit 59a4921ba9
12 changed files with 709 additions and 38 deletions

View file

@ -1,5 +1,8 @@
namespace API.Entities
{
/// <summary>
/// Represents the progress a single user has on a given Volume.
/// </summary>
public class AppUserProgress
{

View file

@ -5,7 +5,15 @@ namespace API.Entities
{
public int Id { get; set; }
public string FilePath { get; set; }
// Should I just store information related to FilePath here? Reset it on anytime FilePath changes?
/// <summary>
/// Do not expect this to be set. If this MangaFile represents a volume file, this will be null.
/// </summary>
public int Chapter { get; set; }
/// <summary>
/// Number of pages for the given file
/// </summary>
public int NumberOfPages { get; set; }
public MangaFormat Format { get; set; }
// Relationship Mapping
public Volume Volume { get; set; }

View file

@ -1,7 +1,14 @@
namespace API.Entities
using System.ComponentModel;
namespace API.Entities
{
public enum MangaFormat
{
[Description("Image")]
Image = 0,
[Description("Archive")]
Archive = 1,
[Description("Unknown")]
Unknown = 2
}
}

View file

@ -13,6 +13,9 @@ namespace API.Entities
public DateTime Created { get; set; }
public DateTime LastModified { get; set; }
public byte[] CoverImage { get; set; }
// public string CachePath {get; set;} // Path where cache is located. Default null, resets to null on deletion.
//public ICollection<AppUserProgress> AppUserProgress { get; set; }
// Many-to-One relationships
public Series Series { get; set; }