mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-23 15:30:34 -04:00
* Some performance refactoring around getting Library and avoid a byte[] copy for getting cover images for epubs. * Initial commit. Rewrote the main series scan loop to use chunks of data at a time. Not fully shaken out. * Hooked in the ability for the UI to react to series being added or removed from the DB. * Cleaned up the messaging in the scan loop to be more clear. * Metadata scan and scan work as expected and populate data to the UI. There is a slow down in speed for overall operation. Scan series and refresh series metadata does not work fully. * Fixed a bug where MangaFiles were not having LastModified Updated correctly, meaning they were opening archives every scan. * Modified the code to be more realistic to the underlying file * Updated ScanService to properly handle deleted files and not result in a higher-level scan. * Shuffled around volume related repo apis to the volume repo rather than being in series. * Rewrote scan series to be much cleaner and more concise on the flow. Fixed an issue in UpdateVolumes such that the debug code to log out removed volumes could throw an exception and actually break updating volumes. * Refactored the code to set MangaFile last modified timestamp into the MangaFile entity. * Added Series Name to ScanSeries event * Added additional checks in ScanSeries to ensure we never go outside the library folder. Added extra debug messages for when a metadata refresh doesn't actually make changes and for when we regen cover images. * More logging statements saying where they originate from. Fixed a critical bug which caused only 1 chunk to ever be processed. * Fixed a concurrency issue with natural sorter which could cause issues in ArchiveService.cs. * Log cleanups * Fixed an issue with logging out total time of a scan. * Only show added toastrs for admins. When kicking off a refresh metadata for series, make sure we regenerate all cover images. * Code smells on benchmark despite it being ignored
67 lines
2.5 KiB
C#
67 lines
2.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using API.Entities.Enums;
|
|
using API.Entities.Interfaces;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace API.Entities
|
|
{
|
|
[Index(nameof(Name), nameof(NormalizedName), nameof(LocalizedName), nameof(LibraryId), nameof(Format), IsUnique = true)]
|
|
public class Series : IEntityDate
|
|
{
|
|
public int Id { get; set; }
|
|
/// <summary>
|
|
/// The UI visible Name of the Series. This may or may not be the same as the OriginalName
|
|
/// </summary>
|
|
public string Name { get; set; }
|
|
/// <summary>
|
|
/// Used internally for name matching. <see cref="Parser.Parser.Normalize"/>
|
|
/// </summary>
|
|
public string NormalizedName { get; set; }
|
|
/// <summary>
|
|
/// The name used to sort the Series. By default, will be the same as Name.
|
|
/// </summary>
|
|
public string SortName { get; set; }
|
|
/// <summary>
|
|
/// Name in Japanese. By default, will be same as Name.
|
|
/// </summary>
|
|
public string LocalizedName { get; set; }
|
|
/// <summary>
|
|
/// Original Name on disk. Not exposed to UI.
|
|
/// </summary>
|
|
public string OriginalName { get; set; }
|
|
/// <summary>
|
|
/// Summary information related to the Series
|
|
/// </summary>
|
|
public string Summary { get; set; } // NOTE: Migrate into SeriesMetdata (with Metadata update)
|
|
public DateTime Created { get; set; }
|
|
public DateTime LastModified { get; set; }
|
|
/// <summary>
|
|
/// Absolute path to the (managed) image file
|
|
/// </summary>
|
|
/// <remarks>The file is managed internally to Kavita's APPDIR</remarks>
|
|
public string CoverImage { get; set; }
|
|
/// <summary>
|
|
/// Denotes if the CoverImage has been overridden by the user. If so, it will not be updated during normal scan operations.
|
|
/// </summary>
|
|
public bool CoverImageLocked { get; set; }
|
|
/// <summary>
|
|
/// Sum of all Volume page counts
|
|
/// </summary>
|
|
public int Pages { get; set; }
|
|
|
|
/// <summary>
|
|
/// The type of all the files attached to this series
|
|
/// </summary>
|
|
public MangaFormat Format { get; set; } = MangaFormat.Unknown;
|
|
|
|
public SeriesMetadata Metadata { get; set; }
|
|
|
|
// Relationships
|
|
public List<Volume> Volumes { get; set; }
|
|
public Library Library { get; set; }
|
|
public int LibraryId { get; set; }
|
|
|
|
}
|
|
}
|