#region ========================================================================= USING ===================================================================================== using Nemera.Application.Common.DataAccess.Entities.Common; using Nemera.Application.Common.DataAccess.Entities.UsersManagement; using Nemera.Domain.SharedKernel.Common.Enums.MediaLibrary; using System; using System.Collections.Generic; using System.Diagnostics; #endregion namespace Nemera.Application.Common.DataAccess.Entities.MediaLibrary.Management; /// /// Repository entity for a media library. /// [DebuggerDisplay("Title: {Title}")] public class LibraryEntity : IStorageEntity, IAuditableEntity { /// /// Gets the Id of the media library. /// public required Guid Id { get; init; } /// /// Gets the Id of the user that owns the media library. /// public required Guid UserId { get; init; } /// /// Gets or sets the title of the media library. /// public required string Title { get; set; } /// /// Gets or sets the path of the image file used as the cover for the library. /// public string? CoverImage { get; set; } /// /// Gets or sets the type of the media library. /// public required LibraryType LibraryType { get; set; } /// /// Gets the list of file system paths that make up the media library. /// public required ICollection ContentLocations { get; init; } = []; /// /// Gets the ordered parts of the template describing the structure of the media library on disk. /// public ICollection PathTemplateParts { get; init; } = []; /// /// Gets the list of scans of the media library. /// public ICollection LibraryScans { get; init; } = []; /// /// Gets whether this media library is enabled or not. A disabled media library is never shown or changed. /// public bool IsEnabled { get; init; } /// /// Gets whether this media library is locked or not. A locked media library is displayed, but is never changed or updated. /// public bool IsLocked { get; init; } /// /// Gets whether this media library should update the metadata of its elements from the web, or not. /// public bool CanDownloadMetadataFromWeb { get; init; } /// /// Gets whether this media library should copy the downloaded metadata into the media library content locations, or not. /// public bool ShouldSaveMetadataInMediaDirectories { get; init; } /// /// Gets or sets whether the unchanged directories are skipped during the scan of the media library. /// public bool ShouldSkipUnchangedDirectoriesDuringScan { get; init; } /// /// Gets whether hidden files and directories are skipped during the scan of the media library. /// public bool ShouldSkipHiddenFilesAndDirectoriesDuringScan { get; init; } /// /// Gets whether the content of this media library is stored on a solid state drive, in which case the file discovery and content hashing stages read the files in parallel. /// public bool IsContentOnSsd { get; init; } /// /// Gets a value indicating whether the consumption progress of the media library items is tracked. /// public bool ShouldTrackConsumptionProgress { get; init; } /// /// Gets the percentage of a media library item that must be consumed for its session to be considered completed, when progress tracking is enabled. /// public int? CompletionThresholdPercentage { get; init; } /// /// Gets or sets the fingerprint of the metadata provider configuration of the media library, used to detect /// whether the configuration changed since the last scan, and thus whether the books need re-enrichment. /// public string? MetadataProvidersConfigurationFingerprint { get; set; } /// /// Gets or sets the fingerprint of the artwork provider configuration of the media library, used to detect /// whether the configuration changed since the last scan, and thus whether the books need their artwork re-resolved. /// public string? ArtworkProvidersConfigurationFingerprint { get; set; } /// /// Gets or sets the fingerprint of the path template of the media library, used to detect whether the template /// changed since the last scan, and thus whether the metadata needs to be derived from the paths again. /// public string? PathTemplateFingerprint { get; set; } /// /// Gets the user that owns the media library. /// public UserEntity User { get; init; } = null!; /// /// Gets or sets the time and date when the entity was added. /// public DateTime CreatedOnUtc { get; set; } /// /// Gets or sets the Id of the user that created the entity. /// public Guid CreatedBy { get; set; } /// /// Gets or sets the optional time and date when the entity was updated. /// public DateTime? UpdatedOnUtc { get; set; } /// /// Gets or sets the optional Id of the user that updated the entity. /// public Guid? UpdatedBy { get; set; } }