mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-23 15:30:34 -04:00
* Implemented the ability to generate reading lists from StoryArc and StoryArcNumber ComicInfo fields. * Refactored to add AlternativeSeries support. * Fixed up the handling when we need to update reading list where order is already present. * Refactored how skipping empty reading list pairs works
70 lines
2.1 KiB
C#
70 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using API.Entities.Enums;
|
|
using API.Entities.Interfaces;
|
|
|
|
namespace API.Entities;
|
|
|
|
public class Library : IEntityDate
|
|
{
|
|
public int Id { get; set; }
|
|
public required string Name { get; set; }
|
|
public string? CoverImage { get; set; }
|
|
public LibraryType Type { get; set; }
|
|
/// <summary>
|
|
/// If Folder Watching is enabled for this library
|
|
/// </summary>
|
|
public bool FolderWatching { get; set; } = true;
|
|
/// <summary>
|
|
/// Include Library series on Dashboard Streams
|
|
/// </summary>
|
|
public bool IncludeInDashboard { get; set; } = true;
|
|
/// <summary>
|
|
/// Include Library series on Recommended Streams
|
|
/// </summary>
|
|
public bool IncludeInRecommended { get; set; } = true;
|
|
/// <summary>
|
|
/// Include library series in Search
|
|
/// </summary>
|
|
public bool IncludeInSearch { get; set; } = true;
|
|
/// <summary>
|
|
/// Should this library create collections from Metadata
|
|
/// </summary>
|
|
public bool ManageCollections { get; set; } = true;
|
|
/// <summary>
|
|
/// Should this library create reading lists from Metadata
|
|
/// </summary>
|
|
public bool ManageReadingLists { get; set; } = true;
|
|
public DateTime Created { get; set; }
|
|
public DateTime LastModified { get; set; }
|
|
public DateTime CreatedUtc { get; set; }
|
|
public DateTime LastModifiedUtc { get; set; }
|
|
|
|
/// <summary>
|
|
/// Last time Library was scanned
|
|
/// </summary>
|
|
/// <remarks>Time stored in UTC</remarks>
|
|
public DateTime LastScanned { get; set; }
|
|
public ICollection<FolderPath> Folders { get; set; } = null!;
|
|
public ICollection<AppUser> AppUsers { get; set; } = null!;
|
|
public ICollection<Series> Series { get; set; } = null!;
|
|
|
|
public void UpdateLastModified()
|
|
{
|
|
LastModified = DateTime.Now;
|
|
LastModifiedUtc = DateTime.UtcNow;
|
|
}
|
|
|
|
public void UpdateLastScanned(DateTime? time)
|
|
{
|
|
if (time == null)
|
|
{
|
|
LastScanned = DateTime.Now;
|
|
}
|
|
else
|
|
{
|
|
LastScanned = (DateTime) time;
|
|
}
|
|
}
|
|
}
|