mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-21 06:20:33 -04:00
* Introduced a new claim on the Token to get UserId as well as Username, thus allowing for many places of reduced DB calls. All users will need to reauthenticate. Introduced UTC Dates throughout the application, they are not exposed in all DTOs, that will come later when we fully switch over. For now, Utc dates will be updated along side timezone specific dates. Refactored get-progress/progress api to be 50% faster by reducing how much data is loaded from the query. * Speed up the following apis: collection/search, download/bookmarks, reader/bookmark-info, recommended/quick-reads, recommended/quick-catchup-reads, recommended/highly-rated, recommended/more-in, recommended/rediscover, want-to-read/ * Added a migration to sync all dates with their new UTC counterpart. * Added LastReadingProgressUtc onto ChapterDto for some browsing apis, but not all. Added LastReadingProgressUtc to reading list items. Refactored the migration to run raw SQL which is much faster. * Added LastReadingProgressUtc onto ChapterDto for some browsing apis, but not all. Added LastReadingProgressUtc to reading list items. Refactored the migration to run raw SQL which is much faster. * Fixed the unit tests * Fixed an issue with auto mapper which was causing progress page number to not get sent to UI * series/volume has chapter last reading progress * Added filesize and library name on reading list item dto for CDisplayEx. * Some minor code cleanup * Forgot to fill a field
66 lines
1.9 KiB
C#
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 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; }
|
|
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;
|
|
}
|
|
}
|
|
}
|