using System; using System.Collections.Generic; using API.Entities.Enums; using API.Entities.Interfaces; namespace API.Entities; public class Library : IEntityDate, IHasCoverImage { public int Id { get; set; } public required string Name { get; set; } public string? CoverImage { get; set; } public string PrimaryColor { get; set; } public string SecondaryColor { get; set; } public LibraryType Type { get; set; } /// /// If Folder Watching is enabled for this library /// public bool FolderWatching { get; set; } = true; /// /// Include Library series on Dashboard Streams /// public bool IncludeInDashboard { get; set; } = true; /// /// Include Library series on Recommended Streams /// public bool IncludeInRecommended { get; set; } = true; /// /// Include library series in Search /// public bool IncludeInSearch { get; set; } = true; /// /// Should this library create collections from Metadata /// public bool ManageCollections { get; set; } = true; /// /// Should this library create reading lists from Metadata /// public bool ManageReadingLists { get; set; } = true; /// /// Should this library allow Scrobble events to emit from it /// /// Requires a valid LicenseKey public bool AllowScrobbling { get; set; } = true; /// /// Allow any series within this Library to download metadata. /// /// This does not exclude the library from being linked to wrt Series Relationships /// Requires a valid LicenseKey public bool AllowMetadataMatching { get; set; } = true; public DateTime Created { get; set; } public DateTime LastModified { get; set; } public DateTime CreatedUtc { get; set; } public DateTime LastModifiedUtc { get; set; } /// /// Last time Library was scanned /// /// Time stored in UTC public DateTime LastScanned { get; set; } public ICollection Folders { get; set; } = null!; public ICollection AppUsers { get; set; } = null!; public ICollection Series { get; set; } = null!; public ICollection LibraryFileTypes { get; set; } = new List(); public ICollection LibraryExcludePatterns { get; set; } = new List(); public void UpdateLastModified() { LastModified = DateTime.Now; LastModifiedUtc = DateTime.UtcNow; } public void UpdateLastScanned(DateTime? time) { if (time == null) { LastScanned = DateTime.Now; } else { LastScanned = (DateTime) time; } } public void ResetColorScape() { PrimaryColor = string.Empty; SecondaryColor = string.Empty; } }