mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-01-04 11:10:22 -05:00
* When skipping over folders in a scan, inform the ui * Try out new backout condition for library watcher. * Tweaked the code for folder watching to be more intense on killing if stuck in inotify loop. * Streamlined my implementation of enhanced LibraryWatcher * Added new extension method to make complex where statements cleaner. * Added an implementation to flatten series and not show them if they have relationships defined. Only the parent would show. Currently disabled until i figure out how to apply it. * Added the ability to collapse series that are not the primary entry point to reading. Configurable in library settings, only applies when all libraries in a filter have the property to true. * Exclude from parsing .@_thumb directories, a QNAP system folder. Show number of items a JumpKey has * Refactored some time reading to display in days, months, years or minutes.
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 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;
|
|
/// <summary>
|
|
/// When showing series, only parent series or series with no relationships will be returned
|
|
/// </summary>
|
|
public bool CollapseSeriesRelationships { get; set; } = false;
|
|
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; }
|
|
public ICollection<AppUser> AppUsers { get; set; }
|
|
public ICollection<Series> Series { get; set; }
|
|
|
|
public void UpdateLastModified()
|
|
{
|
|
LastModified = DateTime.Now;
|
|
LastModifiedUtc = DateTime.UtcNow;
|
|
}
|
|
|
|
public void UpdateLastScanned(DateTime? time)
|
|
{
|
|
if (time == null)
|
|
{
|
|
LastScanned = DateTime.Now;
|
|
}
|
|
else
|
|
{
|
|
LastScanned = (DateTime) time;
|
|
}
|
|
}
|
|
}
|