< Summary

Information
Class: Anichron.Core.Domain.MediaAsset
Assembly: Anichron.Core
File(s): /home/runner/work/anichron/anichron/src/Anichron.Core/Domain/MediaAsset.cs
Tag: 19_45211875487
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 71
Line coverage: 100%
Branch coverage
100%
Covered branches: 18
Total branches: 18
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Captured()100%44100%
set_Captured(...)100%1414100%

File(s)

/home/runner/work/anichron/anichron/src/Anichron.Core/Domain/MediaAsset.cs

#LineLine coverage
 1namespace Anichron.Core.Domain;
 2
 3public 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    {
 10129        get => DateCaptured is { } at && CaptureSource is { } source ? new(at, CaptureOffset, source, CaptureZone) : nul
 30        set
 87331        {
 87332            DateCaptured = value?.At;
 87333            CaptureOffset = value?.Offset;
 87334            CaptureSource = value?.Source;
 87335            CaptureZone = value?.Zone;
 87336            Month = value?.At.Month;
 87337            Day = value?.At.Day;
 87338            Year = value?.At.Year;
 87339        }
 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}