63 lines
2.0 KiB
C#
63 lines
2.0 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Lactose.Models;
|
|
|
|
/// <summary>
|
|
/// Represents a folder with an ID, base path, and active status.
|
|
/// </summary>
|
|
public class Folder {
|
|
/// <summary>
|
|
/// Gets or sets the unique identifier for the folder.
|
|
/// </summary>
|
|
[Key]
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the base path of the folder.
|
|
/// </summary>
|
|
[Required][Column(TypeName = "VARCHAR(2048)")]
|
|
public string BasePath { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether the folder is active.
|
|
/// </summary>
|
|
[Required]
|
|
public bool Active { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the regex pattern used to extract person and group names from asset paths.
|
|
/// Must contain named groups <c>person</c> and <c>group</c>.
|
|
/// </summary>
|
|
[MaxLength(2048)]
|
|
public string? RegexPattern { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the timestamp of the last file-system scan of this folder.
|
|
/// Used by incremental scans to skip directories whose mtime is unchanged.
|
|
/// </summary>
|
|
public DateTime? LastFileScanAt { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the timestamp of the last person/album discovery scan of this folder.
|
|
/// Incremental discovery only processes assets created at or after this timestamp.
|
|
/// </summary>
|
|
public DateTime? LastDiscoveryScanAt { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the regex pattern used during the last discovery scan.
|
|
/// When this differs from <see cref="RegexPattern"/>, discovery automatically re-runs as a full (deep) scan.
|
|
/// </summary>
|
|
[Column(TypeName = "VARCHAR(2048)")]
|
|
public string? LastDiscoveryScannedRegex { get; set; }
|
|
|
|
#region Navigation Properties
|
|
|
|
/// <summary>
|
|
/// Gets or sets the list of assets in this folder.
|
|
/// </summary>
|
|
public List<Asset>? Assets { get; set; }
|
|
|
|
#endregion
|
|
}
|