| | | 1 | | namespace Anichron.Core.Domain; |
| | | 2 | | |
| | | 3 | | public class MediaAsset |
| | | 4 | | { |
| | | 5 | | public Guid Id { get; set; } |
| | | 6 | | public Guid StorageConfigId { get; set; } |
| | | 7 | | public Guid? BurstId { get; set; } |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// Links this asset to its paired secondary asset (e.g. a HEIC photo linked to its Live Photo MOV counterpart). |
| | | 11 | | /// </summary> |
| | | 12 | | public Guid? PairedAssetId { get; set; } |
| | | 13 | | |
| | | 14 | | /// <summary>Whether a photo has ever been paired with this row as its video; set at pairing and never cleared.</sum |
| | | 15 | | public bool IsLivePhotoVideo { get; set; } |
| | | 16 | | |
| | | 17 | | // File Information |
| | | 18 | | // Stryker disable once String |
| | | 19 | | public string FilePath { get; set; } = string.Empty; // Relative to StorageConfig Root |
| | | 20 | | // Stryker disable once String |
| | | 21 | | public string FileName { get; set; } = string.Empty; |
| | | 22 | | // Stryker disable once String |
| | | 23 | | public string ContentHash { get; set; } = string.Empty; // XXHash64 for move tracking |
| | | 24 | | |
| | | 25 | | // Temporal Data (Optimized for "On This Day") |
| | | 26 | | /// <summary>The capture date as one value, set as a whole over its columns; null when the asset is undated.</summar |
| | | 27 | | public CaptureDate? Captured |
| | | 28 | | { |
| | 101 | 29 | | get => DateCaptured is { } at && CaptureSource is { } source ? new(at, CaptureOffset, source, CaptureZone) : nul |
| | | 30 | | set |
| | 873 | 31 | | { |
| | 873 | 32 | | DateCaptured = value?.At; |
| | 873 | 33 | | CaptureOffset = value?.Offset; |
| | 873 | 34 | | CaptureSource = value?.Source; |
| | 873 | 35 | | CaptureZone = value?.Zone; |
| | 873 | 36 | | Month = value?.At.Month; |
| | 873 | 37 | | Day = value?.At.Day; |
| | 873 | 38 | | Year = value?.At.Year; |
| | 873 | 39 | | } |
| | | 40 | | } |
| | | 41 | | |
| | | 42 | | public LocalDateTime? DateCaptured { get; private set; } |
| | | 43 | | public Offset? CaptureOffset { get; private set; } |
| | | 44 | | public CaptureSource? CaptureSource { get; private set; } |
| | | 45 | | public string? CaptureZone { get; private set; } |
| | | 46 | | public int? Month { get; private set; } |
| | | 47 | | public int? Day { get; private set; } |
| | | 48 | | public int? Year { get; private set; } |
| | | 49 | | |
| | | 50 | | // Metadata & State |
| | | 51 | | public MediaType MediaType { get; set; } |
| | | 52 | | public bool IsSoftDeleted { get; set; } |
| | | 53 | | public Instant LastSeenOnNas { get; set; } |
| | | 54 | | |
| | | 55 | | // --- Navigation Properties --- |
| | | 56 | | |
| | | 57 | | public virtual UserStorageConfig StorageConfig { get; set; } = null!; |
| | | 58 | | |
| | | 59 | | public virtual Burst? Burst { get; set; } |
| | | 60 | | |
| | | 61 | | /// <summary> |
| | | 62 | | /// Navigation property for the paired secondary asset. |
| | | 63 | | /// </summary> |
| | | 64 | | public virtual MediaAsset? PairedAsset { get; set; } |
| | | 65 | | |
| | | 66 | | public virtual Metadata? Metadata { get; set; } |
| | | 67 | | |
| | | 68 | | public virtual ICollection<ProxyFile> ProxyFiles { get; set; } = []; |
| | | 69 | | |
| | | 70 | | public virtual ICollection<AssetInteraction> Interactions { get; set; } = []; |
| | | 71 | | } |