Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

686 B
Raw Blame

using System;

namespace API.Entities;

public class FolderPath
{
    public int Id { get; set; }
    public required string Path { get; set; }
    /// <summary>
    /// Used when scanning to see if we can skip if nothing has changed
    /// </summary>
    /// <remarks>Time stored in UTC</remarks>
    public DateTime LastScanned { get; set; }

    // Relationship
    public Library Library { get; set; } = null!;
    public int LibraryId { get; set; }

    public void UpdateLastScanned(DateTime? time)
    {
        if (time == null)
        {
            LastScanned = DateTime.Now;
        }
        else
        {
            LastScanned = (DateTime) time;
        }
    }
}