mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-31 20:24:27 -04:00
* Capture date when Kavita creates a MangaFile so we can show the date on the UI. * On startup, exit early for migration directory if it's a fresh install and we have migrations to run but no settings stored yet. * Blur summaries should apply when there isn't any read more collapsable * Fixed custom theme files not loading. * Cleaned up the logic for displaying the manga file date
52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
|
|
using System;
|
|
using System.IO;
|
|
using API.Entities.Enums;
|
|
using API.Entities.Interfaces;
|
|
|
|
namespace API.Entities
|
|
{
|
|
/// <summary>
|
|
/// Represents a wrapper to the underlying file. This provides information around file, like number of pages, format, etc.
|
|
/// </summary>
|
|
public class MangaFile : IEntityDate
|
|
{
|
|
public int Id { get; set; }
|
|
/// <summary>
|
|
/// Absolute path to the archive file
|
|
/// </summary>
|
|
public string FilePath { get; set; }
|
|
/// <summary>
|
|
/// Number of pages for the given file
|
|
/// </summary>
|
|
public int Pages { get; set; }
|
|
public MangaFormat Format { get; set; }
|
|
/// <inheritdoc cref="IEntityDate.Created"/>
|
|
public DateTime Created { get; set; }
|
|
|
|
/// <summary>
|
|
/// Last time underlying file was modified
|
|
/// </summary>
|
|
/// <remarks>This gets updated anytime the file is scanned</remarks>
|
|
public DateTime LastModified { get; set; }
|
|
/// <summary>
|
|
/// Last time file analysis ran on this file
|
|
/// </summary>
|
|
public DateTime LastFileAnalysis { get; set; }
|
|
|
|
|
|
// Relationship Mapping
|
|
public Chapter Chapter { get; set; }
|
|
public int ChapterId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// Updates the Last Modified time of the underlying file to the LastWriteTime
|
|
/// </summary>
|
|
public void UpdateLastModified()
|
|
{
|
|
LastModified = File.GetLastWriteTime(FilePath);
|
|
}
|
|
}
|
|
}
|