Kavita/API/Entities/Library.cs
Joe Milazzo bd19b282d5
Misc Fixes + Enhancements (#1875)
* Moved Collapse Series with relationships into a user preference rather than library setting.

* Fixed bookmarks not converting to webp after initial save

* Fixed a bug where when merging we'd print out a duplicate series error when we shouldn't have

* Fixed a bug where clicking on a genre or tag from server stats wouldn't load all-series page in a filtered state.

* Implemented the ability to have Login role and thus disable accounts.

* Ensure first time flow gets the Login role

* Refactored user management screen so that pending users can be edited or deleted before the end user accepts the invite. A side effect is old legacy users that were here before email was required can now be deleted.

* Show a progress bar under the main series image on larger viewports to show whole series progress.

* Removed code no longer needed

* Cleanup tags, people, collections without connections after editing series metadata.

* Moved the Entity Builders to the main project
2023-03-10 17:09:38 -08:00

66 lines
1.9 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 and manage collections from Metadata
/// </summary>
public bool ManageCollections { 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;
}
}
}