Renames project paths from Lumina to Nemera

This commit is contained in:
BinaryAlley committed 2026-11-27 15:34:43 +02:00
1 parent ce6fddb4c9
commit 0f659a4877
6450 files changed

No files matched your search

@@ -0,0 +1,56 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.Authorization;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Authorization;
/// <summary>
/// Represents a permission that can be assigned to roles or users within the authorization system.
/// </summary>
[DebuggerDisplay("PermissionName: {PermissionName}")]
public class PermissionEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the permission.
/// </summary>
public Guid Id { get; init; }
/// <summary>
/// Gets the name of the permission.
/// </summary>
public required AuthorizationPermission PermissionName { get; init; }
/// <summary>
/// Gets or sets the collection of role permission associations that include this permission.
/// </summary>
public ICollection<RolePermissionEntity> RolePermissions { get; set; } = [];
/// <summary>
/// Gets or sets the collection of user permission associations that include this permission.
/// </summary>
public ICollection<UserPermissionEntity> UserPermissions { get; set; } = [];
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,56 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.Authorization;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Authorization;
/// <summary>
/// Repository entity for a permission in the authorization system.
/// </summary>
[DebuggerDisplay("RoleName: {RoleName}")]
public class RoleEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the role.
/// </summary>
public Guid Id { get; init; }
/// <summary>
/// Gets the name of the role.
/// </summary>
public required string RoleName { get; init; }
/// <summary>
/// Gets or sets the collection of user roles associations that include this role.
/// </summary>
public ICollection<UserRoleEntity> UserRoles { get; set; } = [];
/// <summary>
/// Gets or sets the collection of role permission associations that include this role.
/// </summary>
public ICollection<RolePermissionEntity> RolePermissions { get; set; } = [];
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,59 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Authorization;
/// <summary>
/// Represents the association between a role and a permission within the authorization system.
/// </summary>
[DebuggerDisplay("Role: {Role.RoleName}; Permission: {Permission.PermissionName}")]
public class RolePermissionEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the role permission.
/// </summary>
public Guid Id { get; init; }
/// <summary>
/// Gets the Id of the role of the role permission.
/// </summary>
public required Guid RoleId { get; init; }
/// <summary>
/// Gets the role of the role permission.
/// </summary>
public required RoleEntity Role { get; init; }
/// <summary>
/// Gets the Id of the permission of the role permissions.
/// </summary>
public required Guid PermissionId { get; init; }
/// <summary>
/// Gets the permission of the role permission.
/// </summary>
public required PermissionEntity Permission { get; init; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,30 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.Authorization;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Authorization;
/// <summary>
/// Data Transfer Object containing all the authorization info of a user.
/// </summary>
[DebuggerDisplay("UserId: {UserId}")]
public class UserAuthorizationEntity
{
/// <summary>
/// Gets the Id of the user.
/// </summary>
public required Guid UserId { get; init; }
/// <summary>
/// Gets the role associated to the user.
/// </summary>
public required string? Role { get; init; }
/// <summary>
/// Gets the collection of permissions associated to the user.
/// </summary>
public required IReadOnlySet<AuthorizationPermission> Permissions { get; init; }
}
@@ -0,0 +1,60 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Authorization;
/// <summary>
/// Represents the association between a user and a permission within the authorization system.
/// </summary>
[DebuggerDisplay("User: {User.Username}; Permission: {Permission.PermissionName}")]
public class UserPermissionEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the user permission.
/// </summary>
public Guid Id { get; init; }
/// <summary>
/// Gets the Id of the user of the user permission.
/// </summary>
public required Guid UserId { get; init; }
/// <summary>
/// Gets the user of the user permission.
/// </summary>
public required UserEntity User { get; init; }
/// <summary>
/// Gets the Id of the permission of the user permission.
/// </summary>
public required Guid PermissionId { get; init; }
/// <summary>
/// Gets the permission of the user permission.
/// </summary>
public required PermissionEntity Permission { get; init; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,60 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Authorization;
/// <summary>
/// Represents the association between a user and a role within the authorization system.
/// </summary>
[DebuggerDisplay("User: {User.Username}; Role: {Role.RoleName}")]
public class UserRoleEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the user role.
/// </summary>
public Guid Id { get; init; }
/// <summary>
/// Gets the Id of the user of the user role.
/// </summary>
public required Guid UserId { get; init; }
/// <summary>
/// Gets the user of the user role.
/// </summary>
public required UserEntity User { get; init; }
/// <summary>
/// Gets the Id of the role of the user role.
/// </summary>
public required Guid RoleId { get; init; }
/// <summary>
/// Gets the role of the user role.
/// </summary>
public required RoleEntity Role { get; init; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,20 @@
#region ========================================================================= USING =====================================================================================
using System;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Common;
/// <summary>
/// Defines the fixed audit identities used by the persistence layer.
/// </summary>
/// <remarks>
/// The SYSTEM identity is only for the explicit one-time application initialization save. Ordinary anonymous creation and modification remain
/// unattributed with <see cref="Guid.Empty"/>; the SYSTEM identity is never inferred from a missing authenticated user.
/// </remarks>
public static class AuditIdentities
{
/// <summary>
/// The fixed identifier of the SYSTEM audit user, used for rows created during application initialization, before any user account exists.
/// </summary>
public static readonly Guid s_systemUserId = Guid.Parse("11111111-1111-1111-1111-111111111111");
}
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Common;
/// <summary>
/// Represents a genre.
/// </summary>
/// <param name="Name">Gets the name of the genre.</param>
[DebuggerDisplay("Name: {Name}")]
public record GenreEntity(
string? Name
) : ISharedReferenceEntity;
@@ -0,0 +1,31 @@
#region ========================================================================= USING =====================================================================================
using System;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Common;
/// <summary>
/// Interface for the properties required for auditing changes to an entity.
/// </summary>
public interface IAuditableEntity
{
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,12 @@
namespace Lumina.Application.Common.DataAccess.Entities.Common;
/// <summary>
/// Interface for a shared reference entity, whose identity is its normalized name and whose rows are shared across the whole storage medium instead of being owned by a single parent.
/// </summary>
public interface ISharedReferenceEntity
{
/// <summary>
/// Gets the name that identifies the shared reference, stored in lowercase and culture-invariant form.
/// </summary>
string? Name { get; }
}
@@ -0,0 +1,16 @@
#region ========================================================================= USING =====================================================================================
using System;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Common;
/// <summary>
/// Interface for storage models, enforces Id.
/// </summary>
public interface IStorageEntity
{
/// <summary>
/// Gets or sets the identifier of the entity.
/// </summary>
Guid Id { get; init; }
}
@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Common;
/// <summary>
/// Represents a rating.
/// </summary>
/// <param name="Value">Gets the rating value.</param>
/// <param name="MaxValue">Gets the maximum possible rating value.</param>
/// <param name="VoteCount">Gets the number of votes that contributed to the rating.</param>
[DebuggerDisplay("{Value}/{MaxValue}")]
public abstract record RatingEntity(
decimal? Value,
decimal? MaxValue,
int? VoteCount
);
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Common;
/// <summary>
/// Represents a tag.
/// </summary>
/// <param name="Name">Gets the name of the tag.</param>
[DebuggerDisplay("Name: {Name}")]
public record TagEntity(
string? Name
) : ISharedReferenceEntity;
@@ -0,0 +1,59 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.Favorites;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Favorites;
/// <summary>
/// Repository entity for a favorite - the marker of a user on a media item of any media kind.
/// </summary>
/// <remarks>
/// The favorite references the media item by its kind and its Id, without a foreign key, so the same table serves every media context and a
/// favorite survives the deletion of the item it references, so its owner can still see and remove it.
/// </remarks>
[DebuggerDisplay("Id: {Id}; MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")]
public class FavoriteEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the favorite.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the user that owns the favorite.
/// </summary>
public required Guid UserId { get; set; }
/// <summary>
/// Gets or sets the kind of the favorited media item.
/// </summary>
public required FavoriteMediaKind MediaKind { get; set; }
/// <summary>
/// Gets or sets the Id of the favorited media item.
/// </summary>
public required Guid MediaItemId { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,21 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.FileSystemManagement;
/// <summary>
/// Generic filesystem data transfer object.
/// </summary>
/// <param name="Path">The path of the file system item.</param>
/// <param name="Name">The name of the file system item.</param>
/// <param name="DateCreated">The creation date of the file system item.</param>
/// <param name="DateModified">The modification date of the file system item.</param>
[DebuggerDisplay("Name: {Name}")]
public record FileSystemItemEntity(
string Path,
string Name,
DateTime DateCreated,
DateTime DateModified
);
@@ -0,0 +1,118 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.MediaConsumption;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaConsumption;
/// <summary>
/// Repository entity for a media consumption session.
/// </summary>
[DebuggerDisplay("Id: {Id}; MediaKind: {MediaKind}; Status: {Status}")]
public class MediaConsumptionRecordEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the consumption record.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the user that started the consumption session.
/// </summary>
public required Guid UserId { get; set; }
/// <summary>
/// Gets or sets the Id of the media library that contains the consumed media item.
/// </summary>
public required Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the kind of media that was consumed.
/// </summary>
public required MediaKind MediaKind { get; set; }
/// <summary>
/// Gets or sets the Id of the consumed media item.
/// </summary>
public required Guid MediaItemId { get; set; }
/// <summary>
/// Gets or sets the state of the consumption session.
/// </summary>
public ConsumptionStatus Status { get; set; }
/// <summary>
/// Gets or sets the date and time when the consumption session started.
/// </summary>
public required DateTime StartedOnUtc { get; set; }
/// <summary>
/// Gets or sets the date and time when the consumption session last received activity.
/// </summary>
public DateTime LastActivityOnUtc { get; set; }
/// <summary>
/// Gets or sets the date and time when the consumption session completed or stopped, if it has ended.
/// </summary>
public DateTime? EndedOnUtc { get; set; }
/// <summary>
/// Gets or sets the active duration consumed by the session, in milliseconds. It is stored as a whole number of milliseconds so that the
/// stored value is independent of the persistence medium's support for time values.
/// </summary>
public long ConsumedDurationMilliseconds { get; set; }
/// <summary>
/// Gets or sets the kind of representation used by the last known position, if the session has a known position.
/// </summary>
public MediaPositionKind? LastPositionKind { get; set; }
/// <summary>
/// Gets or sets the last known position within the media item, in milliseconds, when the position is a time offset.
/// </summary>
public long? LastPositionTimeOffsetMilliseconds { get; set; }
/// <summary>
/// Gets or sets the last known opaque locator within the media item, when the position is not a time offset.
/// </summary>
public string? LastPositionLocation { get; set; }
/// <summary>
/// Gets or sets the latest reported progress fraction of the media item.
/// </summary>
public double LastProgressFraction { get; set; }
/// <summary>
/// Gets or sets the number of consecutive pages read in the consumption session.
/// </summary>
public int ConsecutivePagesRead { get; set; }
/// <summary>
/// Gets or sets the version of the stored row. It is used as an optimistic concurrency token, so that a report that read the record before
/// another report changed it can never overwrite the newer state.
/// </summary>
public long Version { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,92 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.MediaConsumption;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaConsumption;
/// <summary>
/// Repository entity for the point at which a user can resume consuming a media item.
/// </summary>
[DebuggerDisplay("Id: {Id}; MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")]
public class MediaResumePointEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the resume point.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the user that owns the resume point.
/// </summary>
public required Guid UserId { get; set; }
/// <summary>
/// Gets or sets the Id of the media library that contains the media item.
/// </summary>
public required Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the kind of media that is resumed.
/// </summary>
public required MediaKind MediaKind { get; set; }
/// <summary>
/// Gets or sets the Id of the media item to resume.
/// </summary>
public required Guid MediaItemId { get; set; }
/// <summary>
/// Gets the kind of representation used by the position at which the media item can be resumed.
/// </summary>
public required MediaPositionKind LastPositionKind { get; init; }
/// <summary>
/// Gets or sets the position within the media item, in milliseconds, when the position is a time offset.
/// </summary>
public long? LastPositionTimeOffsetMilliseconds { get; set; }
/// <summary>
/// Gets or sets the opaque locator within the media item, when the position is not a time offset.
/// </summary>
public string? LastPositionLocation { get; set; }
/// <summary>
/// Gets or sets the progress fraction at which the media item can be resumed.
/// </summary>
public double LastProgressFraction { get; set; }
/// <summary>
/// Gets or sets the date and time when the media item was last consumed.
/// </summary>
public DateTime LastConsumedOnUtc { get; set; }
/// <summary>
/// Gets or sets the version of the stored row. It is used as an optimistic concurrency token, so that a report that read the resume point before
/// another report changed it can never overwrite the newer state.
/// </summary>
public long Version { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,65 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaContributors;
/// <summary>
/// Repository entity for a media contributor, the person that contributed to one or more media items.
/// The contributor is a person, unique by name, and agnostic of the kind of media it contributed to.
/// </summary>
[DebuggerDisplay("DisplayName: {DisplayName}")]
public class MediaContributorEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the media contributor.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the name by which the contributor is popularly known.
/// </summary>
public required string DisplayName { get; set; }
/// <summary>
/// Gets or sets the legal name of the contributor.
/// </summary>
public string? LegalName { get; set; }
/// <summary>
/// Gets or sets the biography of the contributor.
/// </summary>
public string? Biography { get; set; }
/// <summary>
/// Gets or sets the date of birth of the contributor.
/// </summary>
public DateOnly? DateOfBirth { get; set; }
/// <summary>
/// Gets or sets the date of death of the contributor.
/// </summary>
public DateOnly? DateOfDeath { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for a catalog number of a music release. A release can carry more than one catalog number at the same time.
/// </summary>
/// <param name="CatalogNumber">The catalog number assigned by the label.</param>
[DebuggerDisplay("CatalogNumber: {CatalogNumber}")]
public record AlbumCatalogNumberEntity(
string CatalogNumber
);
@@ -0,0 +1,56 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for the participation of a media contributor in an album, carrying the role the contributor played in that album.
/// The role is tracked per participation, so that a single contributor can play multiple roles in the same album, or different roles in different albums.
/// </summary>
[DebuggerDisplay("AlbumId: {AlbumId} MediaContributorId: {MediaContributorId}")]
public class AlbumContributorEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the participation.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the album the contributor participated in.
/// </summary>
public required Guid AlbumId { get; init; }
/// <summary>
/// Gets the Id of the media contributor.
/// </summary>
public required Guid MediaContributorId { get; init; }
/// <summary>
/// Gets the role the contributor played in the album.
/// </summary>
public required MediaContributorRole Role { get; init; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,264 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.Common;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for an album, a release of an artist.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class AlbumEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the album.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the artist the album belongs to.
/// </summary>
public required Guid ArtistId { get; set; }
/// <summary>
/// Gets or sets the Id of the media library the artist of the album belongs to.
/// </summary>
public required Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the title of the album.
/// </summary>
public required string Title { get; set; }
/// <summary>
/// Gets or sets the original title of the album, if applicable.
/// </summary>
public string? OriginalTitle { get; set; }
/// <summary>
/// Gets or sets the title of the specific release (edition) the album files match, if different from the release group title.
/// </summary>
public string? ReleaseTitle { get; set; }
/// <summary>
/// Gets or sets the description of the album, if applicable.
/// </summary>
public string? Description { get; set; }
/// <summary>
/// Gets or sets the disambiguation comment of the album, used to distinguish albums with the same title, if applicable.
/// </summary>
public string? Disambiguation { get; set; }
/// <summary>
/// Gets or sets the original release date of the album, if applicable.
/// </summary>
public DateOnly? OriginalReleaseDate { get; set; }
/// <summary>
/// Gets or sets the original release year of the album, if applicable.
/// </summary>
public int? OriginalReleaseYear { get; set; }
/// <summary>
/// Gets or sets the re-release or reissue date of the album, if applicable.
/// </summary>
public DateOnly? ReReleaseDate { get; set; }
/// <summary>
/// Gets or sets the re-release or reissue year of the album, if applicable.
/// </summary>
public int? ReReleaseYear { get; set; }
/// <summary>
/// Gets or sets the country or region of release, if applicable.
/// </summary>
public ReleaseCountry? ReleaseCountry { get; set; }
/// <summary>
/// Gets or sets the release version or edition of the album, if applicable.
/// </summary>
public string? ReleaseVersion { get; set; }
/// <summary>
/// Gets or sets the ISO 639-1 two-letter language code of the album, if applicable.
/// </summary>
public string? LanguageCode { get; set; }
/// <summary>
/// Gets or sets the full name of the language of the album in English, if applicable.
/// </summary>
public string? LanguageName { get; set; }
/// <summary>
/// Gets or sets the native name of the language of the album, if applicable.
/// </summary>
public string? LanguageNativeName { get; set; }
/// <summary>
/// Gets or sets the ISO 639-1 two-letter original language code of the album, if applicable.
/// </summary>
public string? OriginalLanguageCode { get; set; }
/// <summary>
/// Gets or sets the full name of the original language of the album in English, if applicable.
/// </summary>
public string? OriginalLanguageName { get; set; }
/// <summary>
/// Gets or sets the native name of the original language of the album, if applicable.
/// </summary>
public string? OriginalLanguageNativeName { get; set; }
/// <summary>
/// Gets or sets the script used by the language of the release of the album, if applicable.
/// </summary>
public string? Script { get; set; }
/// <summary>
/// Gets or sets the status of the release, if applicable.
/// </summary>
public MusicReleaseStatus? ReleaseStatus { get; set; }
/// <summary>
/// Gets or sets the number of discs of the release, if applicable.
/// </summary>
public int? TotalDiscs { get; set; }
/// <summary>
/// Gets or sets the number of tracks of the release.
/// </summary>
public int TotalTracks { get; set; }
/// <summary>
/// Gets or sets the physical or digital medium of the album, if applicable.
/// </summary>
public MusicMediaFormat? MediaFormat { get; set; }
/// <summary>
/// Gets or sets the outermost physical packaging of the album, if applicable.
/// </summary>
public MusicReleasePackaging? Packaging { get; set; }
/// <summary>
/// Gets or sets the barcode of the album, if applicable.
/// </summary>
public string? Barcode { get; set; }
/// <summary>
/// Gets or sets the catalog numbers of the album.
/// </summary>
public List<AlbumCatalogNumberEntity> CatalogNumbers { get; set; } = [];
/// <summary>
/// Gets or sets the name of the label that issued the album, if applicable.
/// </summary>
public string? Label { get; set; }
/// <summary>
/// Gets or sets the ASIN (Amazon Standard Identification Number) of the album, if applicable.
/// </summary>
public string? ASIN { get; set; }
/// <summary>
/// Gets or sets the MusicBrainz identifier of the release, if applicable.
/// </summary>
public Guid? MusicBrainzReleaseId { get; set; }
/// <summary>
/// Gets or sets the MusicBrainz identifier of the release group, if applicable.
/// </summary>
public Guid? MusicBrainzReleaseGroupId { get; set; }
/// <summary>
/// Gets or sets the MusicBrainz identifier of the release artist, if applicable.
/// </summary>
public Guid? MusicBrainzReleaseArtistId { get; set; }
/// <summary>
/// Gets or sets the artist the album belongs to.
/// </summary>
public ArtistEntity? Artist { get; set; }
/// <summary>
/// Gets or sets the tracks of the album.
/// </summary>
public List<TrackEntity> Tracks { get; set; } = [];
/// <summary>
/// Gets or sets the list of ratings for this album.
/// </summary>
public List<AudioRatingEntity> Ratings { get; set; } = [];
/// <summary>
/// Gets or sets the list of the media contributors of the album.
/// </summary>
public List<AlbumContributorEntity> Contributors { get; set; } = [];
/// <summary>
/// Gets or sets the types of the release. A release can carry more than one type at the same time.
/// </summary>
public List<AlbumReleaseTypeEntity> ReleaseTypes { get; set; } = [];
/// <summary>
/// Gets or sets the genres of the album.
/// </summary>
public HashSet<GenreEntity> Genres { get; set; } = [];
/// <summary>
/// Gets or sets the tags of the album.
/// </summary>
public HashSet<TagEntity> Tags { get; set; } = [];
/// <summary>
/// Gets or sets the status of the metadata enrichment of the album.
/// </summary>
public MetadataStatus MetadataStatus { get; set; }
/// <summary>
/// Gets or sets the date and time when the metadata of the album was last enriched.
/// </summary>
public DateTime? LastMetadataUpdateUtc { get; set; }
/// <summary>
/// Gets or sets the name of the plugin that enriched the metadata of the album.
/// </summary>
public string? MetadataProvider { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the album was deleted by the user and is waiting to be restored or permanently removed.
/// A deleted album is kept out of every catalogue read and is not materialized again by scans, so that an automatic scan never undoes the deletion.
/// </summary>
public bool IsDeleted { get; set; }
/// <summary>
/// Gets or sets the date and time when the album was deleted, or <see langword="null"/> when the album is not deleted.
/// </summary>
public DateTime? DeletedOnUtc { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,15 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for a type of a music release. A release can carry more than one type at the same time.
/// </summary>
/// <param name="ReleaseType">The type of the release.</param>
[DebuggerDisplay("ReleaseType: {ReleaseType}")]
public record AlbumReleaseTypeEntity(
MusicReleaseType ReleaseType
);
@@ -0,0 +1,29 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for an alternative name of a music artist.
/// </summary>
/// <param name="Name">The name of the alias.</param>
/// <param name="SortName">The sort name of the alias, if applicable.</param>
/// <param name="Type">The type of the alias, if applicable.</param>
/// <param name="Locale">The locale the alias is used in, if applicable.</param>
/// <param name="IsPrimary">Whether this is the primary alias of the artist.</param>
/// <param name="BeginDate">The date the alias began being used, if applicable.</param>
/// <param name="EndDate">The date the alias stopped being used, if applicable.</param>
/// <param name="IsEnded">Whether the alias is no longer used.</param>
[DebuggerDisplay("Name: {Name}")]
public record ArtistAliasEntity(
string Name,
string? SortName,
string? Type,
string? Locale,
bool IsPrimary,
DateOnly? BeginDate,
DateOnly? EndDate,
bool IsEnded
);
@@ -0,0 +1,56 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for the participation of a media contributor in an artist, carrying the role the contributor played in that artist.
/// The role is tracked per participation, so that a single contributor can play multiple roles in the same artist, or different roles in different artists.
/// </summary>
[DebuggerDisplay("ArtistId: {ArtistId} MediaContributorId: {MediaContributorId}")]
public class ArtistContributorEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the participation.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the artist the contributor participated in.
/// </summary>
public required Guid ArtistId { get; init; }
/// <summary>
/// Gets the Id of the media contributor.
/// </summary>
public required Guid MediaContributorId { get; init; }
/// <summary>
/// Gets the role the contributor played in the artist.
/// </summary>
public required MediaContributorRole Role { get; init; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,183 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for an artist.
/// </summary>
[DebuggerDisplay("Name: {Name}")]
public class ArtistEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the artist.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the media library this artist belongs to.
/// </summary>
public required Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the name of the artist.
/// </summary>
public required string Name { get; set; }
/// <summary>
/// Gets or sets the sort name of the artist, a variant of the name used when sorting artists, if applicable.
/// </summary>
public string? SortName { get; set; }
/// <summary>
/// Gets or sets the disambiguation comment of the artist, used to distinguish artists with the same name, if applicable.
/// </summary>
public string? Disambiguation { get; set; }
/// <summary>
/// Gets or sets the type of the artist, if applicable.
/// </summary>
public MusicArtistType? Type { get; set; }
/// <summary>
/// Gets or sets the gender of the artist, applicable only to artists that are persons or characters, if applicable.
/// </summary>
public MusicArtistGender? Gender { get; set; }
/// <summary>
/// Gets or sets the ISO 3166-1 alpha-2 code of the country the artist is associated with, if applicable.
/// </summary>
public string? Country { get; set; }
/// <summary>
/// Gets or sets the date the artist started existing, if applicable.
/// </summary>
public DateOnly? LifeSpanBegin { get; set; }
/// <summary>
/// Gets or sets the date the artist stopped existing, if applicable.
/// </summary>
public DateOnly? LifeSpanEnd { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the artist no longer exists.
/// </summary>
public bool IsEnded { get; set; }
/// <summary>
/// Gets or sets the website of the artist, if applicable.
/// </summary>
public string? Website { get; set; }
/// <summary>
/// Gets or sets the MusicBrainz identifier of the artist, if applicable.
/// </summary>
public Guid? MusicBrainzArtistId { get; set; }
/// <summary>
/// Gets or sets the area the artist is primarily identified with, if applicable.
/// </summary>
public MusicAreaEntity? Area { get; set; }
/// <summary>
/// Gets or sets the area the artist began in, if applicable.
/// </summary>
public MusicAreaEntity? BeginArea { get; set; }
/// <summary>
/// Gets or sets the area the artist ended in, if applicable.
/// </summary>
public MusicAreaEntity? EndArea { get; set; }
/// <summary>
/// Gets or sets the list of alternative names of the artist.
/// </summary>
public List<ArtistAliasEntity> Aliases { get; set; } = [];
/// <summary>
/// Gets or sets the list of IPI (Interested Party Information) codes of the artist.
/// </summary>
public List<ArtistIpiEntity> Ipis { get; set; } = [];
/// <summary>
/// Gets or sets the list of ISNI (International Standard Name Identifier) codes of the artist.
/// </summary>
public List<ArtistIsniEntity> Isnis { get; set; } = [];
/// <summary>
/// Gets or sets the genres of the artist.
/// </summary>
public HashSet<GenreEntity> Genres { get; set; } = [];
/// <summary>
/// Gets or sets the tags of the artist.
/// </summary>
public HashSet<TagEntity> Tags { get; set; } = [];
/// <summary>
/// Gets or sets the list of ratings of the artist.
/// </summary>
public List<AudioRatingEntity> Ratings { get; set; } = [];
/// <summary>
/// Gets or sets the albums of the artist.
/// </summary>
public List<AlbumEntity> Albums { get; set; } = [];
/// <summary>
/// Gets or sets the list of the media contributors that make up the artist.
/// </summary>
public List<ArtistContributorEntity> Contributors { get; set; } = [];
/// <summary>
/// Gets or sets the status of the metadata enrichment of the artist.
/// </summary>
public MetadataStatus MetadataStatus { get; set; }
/// <summary>
/// Gets or sets the date and time when the metadata of the artist was last enriched.
/// </summary>
public DateTime? LastMetadataUpdateUtc { get; set; }
/// <summary>
/// Gets or sets the name of the plugin that enriched the metadata of the artist.
/// </summary>
public string? MetadataProvider { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the artist was deleted by the user and is waiting to be restored or permanently removed.
/// A deleted artist is kept out of every catalogue read and is not materialized again by scans, so that an automatic scan never undoes the deletion.
/// </summary>
public bool IsDeleted { get; set; }
/// <summary>
/// Gets or sets the date and time when the artist was deleted, or <see langword="null"/> when the artist is not deleted.
/// </summary>
public DateTime? DeletedOnUtc { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for an IPI (Interested Party Information) code of a music artist.
/// </summary>
/// <param name="Value">The value of the IPI code.</param>
[DebuggerDisplay("Value: {Value}")]
public record ArtistIpiEntity(
string Value
);
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for an ISNI (International Standard Name Identifier) code of a music artist.
/// </summary>
/// <param name="Value">The value of the ISNI code.</param>
[DebuggerDisplay("Value: {Value}")]
public record ArtistIsniEntity(
string Value
);
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for the rating of an audio media element.
/// </summary>
/// <param name="Value">The rating value of the audio media element.</param>
/// <param name="MaxValue">The maximum possible rating value of the audio media element.</param>
/// <param name="Source">The source of the audio rating (e.g., a specific website or platform).</param>
/// <param name="VoteCount">The number of votes that contributed to the audio rating.</param>
[DebuggerDisplay("{Value}/{MaxValue}")]
public record AudioRatingEntity(
decimal? Value,
decimal? MaxValue,
AudioRatingSource? Source,
int? VoteCount
) : RatingEntity(Value, MaxValue, VoteCount);
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for a MusicBrainz area, the geographic area a music artist is associated with.
/// </summary>
/// <param name="MusicBrainzAreaId">The MusicBrainz identifier of the area.</param>
/// <param name="Name">The name of the area.</param>
/// <param name="SortName">The sort name of the area, if applicable.</param>
/// <param name="Disambiguation">The disambiguation comment of the area, if applicable.</param>
/// <param name="Type">The MusicBrainz type of the area, if applicable.</param>
/// <param name="Iso3166Code">The ISO 3166 code of the area, if applicable.</param>
[DebuggerDisplay("Name: {Name}")]
public record MusicAreaEntity(
Guid MusicBrainzAreaId,
string Name,
string? SortName,
string? Disambiguation,
string? Type,
string? Iso3166Code
);
@@ -0,0 +1,91 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for a piece of artwork of a music library item, like the cover of an album or the image of an artist.
/// </summary>
/// <remarks>
/// A music library item can have multiple pieces of artwork of different types, and multiple instances of the same type
/// (like the front cover, the back cover and the booklet pages of an album), each tracked independently so that a change
/// of one artwork does not require the others to be re-fetched.
/// </remarks>
[DebuggerDisplay("OwnerType: {OwnerType} OwnerId: {OwnerId} Type: {ArtworkType} Ordinal: {Ordinal}")]
public class MusicArtworkEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the artwork.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the type of the music library item that owns the artwork.
/// </summary>
public required MusicArtworkOwnerType OwnerType { get; set; }
/// <summary>
/// Gets or sets the Id of the music library item that owns the artwork.
/// </summary>
public required Guid OwnerId { get; set; }
/// <summary>
/// Gets or sets the type of the artwork.
/// </summary>
public required ArtworkType ArtworkType { get; set; }
/// <summary>
/// Gets or sets the ordinal of the artwork within its type, so that multiple artworks of the same type can be ordered.
/// </summary>
public required int Ordinal { get; set; }
/// <summary>
/// Gets or sets the relative file name of the stored artwork, if the artwork has been resolved.
/// </summary>
public string? FileName { get; set; }
/// <summary>
/// Gets or sets the content hash of the stored artwork, used to detect whether a re-resolved artwork differs from the stored one.
/// </summary>
public ulong ContentHash { get; set; }
/// <summary>
/// Gets or sets the status of the artwork enrichment.
/// </summary>
public required ArtworkStatus Status { get; set; }
/// <summary>
/// Gets or sets the name of the plugin that resolved the artwork, if applicable.
/// </summary>
public string? Provider { get; set; }
/// <summary>
/// Gets or sets the date and time when the artwork was last resolved, if applicable.
/// </summary>
public DateTime? LastUpdateUtc { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,176 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for the metadata extracted from a discovered music file, staged during a scan, before the artists, albums and tracks are materialized from it.
/// </summary>
[DebuggerDisplay("Path: {Path}")]
public class MusicLibraryScanItemMetadataEntity : IStorageEntity
{
/// <summary>
/// Gets the Id of the staged music metadata.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the media library scan that this staged music metadata belongs to.
/// </summary>
public required Guid LibraryScanId { get; init; }
/// <summary>
/// Gets the Id of the media library that this staged music metadata belongs to.
/// </summary>
public required Guid LibraryId { get; init; }
/// <summary>
/// Gets the file system path of the music file whose metadata was extracted.
/// </summary>
public required string Path { get; init; }
/// <summary>
/// Gets the name of the artist, if applicable.
/// </summary>
public string? ArtistName { get; set; }
/// <summary>
/// Gets the type of the release, if applicable.
/// </summary>
public MusicReleaseType? ReleaseType { get; set; }
/// <summary>
/// Gets the release year, if applicable.
/// </summary>
public int? ReleaseYear { get; set; }
/// <summary>
/// Gets the name of the release, if applicable.
/// </summary>
public string? ReleaseName { get; set; }
/// <summary>
/// Gets the title of the track, if applicable.
/// </summary>
public string? TrackTitle { get; set; }
/// <summary>
/// Gets the number of the track on its disc, if applicable.
/// </summary>
public int? TrackNumber { get; set; }
/// <summary>
/// Gets the number of the disc the track belongs to, if applicable.
/// </summary>
public int? DiscNumber { get; set; }
/// <summary>
/// Gets the duration of the audio in seconds.
/// </summary>
public int DurationInSeconds { get; set; }
/// <summary>
/// Gets the sample rate of the audio in Hz.
/// </summary>
public int SampleRate { get; set; }
/// <summary>
/// Gets the number of audio channels.
/// </summary>
public int Channels { get; set; }
/// <summary>
/// Gets the bit depth of the audio, if applicable.
/// </summary>
public int? BitDepth { get; set; }
/// <summary>
/// Gets the audio codec used, if applicable.
/// </summary>
public string? AudioCodec { get; set; }
/// <summary>
/// Gets or sets the container of the audio file, for example MP3, FLAC, OGG, AAC, MP4 or WAV, if applicable.
/// </summary>
public string? Container { get; set; }
/// <summary>
/// Gets or sets the bitrate of the audio in kbps, if applicable.
/// </summary>
public int? Bitrate { get; set; }
/// <summary>
/// Gets or sets the AcoustID fingerprint identifier of the audio file, if applicable.
/// </summary>
public string? AcoustId { get; set; }
/// <summary>
/// Gets or sets the ReplayGain track gain in decibels, if applicable.
/// </summary>
public decimal? ReplayGainTrackGain { get; set; }
/// <summary>
/// Gets or sets the ReplayGain track peak, if applicable.
/// </summary>
public decimal? ReplayGainTrackPeak { get; set; }
/// <summary>
/// Gets or sets the ReplayGain album gain in decibels, if applicable.
/// </summary>
public decimal? ReplayGainAlbumGain { get; set; }
/// <summary>
/// Gets or sets the ReplayGain album peak, if applicable.
/// </summary>
public decimal? ReplayGainAlbumPeak { get; set; }
/// <summary>
/// Gets or sets the moods of the track, read from the tags of the file.
/// </summary>
public List<string> Moods { get; set; } = [];
/// <summary>
/// Gets the MusicBrainz identifier of the artist, read from the tags of the file, if applicable.
/// </summary>
public Guid? MusicBrainzArtistId { get; set; }
/// <summary>
/// Gets the MusicBrainz identifier of the release artist, read from the tags of the file, if applicable.
/// </summary>
public Guid? MusicBrainzReleaseArtistId { get; set; }
/// <summary>
/// Gets the MusicBrainz identifier of the release group, read from the tags of the file, if applicable.
/// </summary>
public Guid? MusicBrainzReleaseGroupId { get; set; }
/// <summary>
/// Gets the MusicBrainz identifier of the release, read from the tags of the file, if applicable.
/// </summary>
public Guid? MusicBrainzReleaseId { get; set; }
/// <summary>
/// Gets the MusicBrainz identifier of the recording, read from the tags of the file, if applicable.
/// </summary>
public Guid? MusicBrainzRecordingId { get; set; }
/// <summary>
/// Gets the MusicBrainz identifier of the track, read from the tags of the file, if applicable.
/// </summary>
public Guid? MusicBrainzTrackId { get; set; }
/// <summary>
/// Gets the MusicBrainz identifier of the work the track is a recording of, read from the tags of the file, if applicable.
/// </summary>
public Guid? MusicBrainzWorkId { get; set; }
/// <summary>
/// Gets the title of the work the track is a recording of, read from the tags of the file, if applicable.
/// </summary>
public string? WorkTitle { get; set; }
}
@@ -0,0 +1,56 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for the participation of a media contributor in a track, carrying the role the contributor played in that track.
/// The role is tracked per participation, so that a single contributor can play multiple roles in the same track, or different roles in different tracks.
/// </summary>
[DebuggerDisplay("TrackId: {TrackId} MediaContributorId: {MediaContributorId}")]
public class TrackContributorEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the participation.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the track the contributor participated in.
/// </summary>
public required Guid TrackId { get; init; }
/// <summary>
/// Gets the Id of the media contributor.
/// </summary>
public required Guid MediaContributorId { get; init; }
/// <summary>
/// Gets the role the contributor played in the track.
/// </summary>
public required MediaContributorRole Role { get; init; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,324 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.Common;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for a track, the individual song of an album.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class TrackEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the track.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the album the track belongs to.
/// </summary>
public required Guid AlbumId { get; set; }
/// <summary>
/// Gets or sets the Id of the media library this track belongs to.
/// </summary>
public required Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the file system path of the track.
/// </summary>
public required string Path { get; set; }
/// <summary>
/// Gets or sets the title of the track.
/// </summary>
public required string Title { get; set; }
/// <summary>
/// Gets or sets the original title of the track, if applicable.
/// </summary>
public string? OriginalTitle { get; set; }
/// <summary>
/// Gets or sets the description of the track, if applicable.
/// </summary>
public string? Description { get; set; }
/// <summary>
/// Gets or sets the disambiguation comment of the track, used to distinguish tracks with the same title, if applicable.
/// </summary>
public string? Disambiguation { get; set; }
/// <summary>
/// Gets or sets the original release date of the track, if applicable.
/// </summary>
public DateOnly? OriginalReleaseDate { get; set; }
/// <summary>
/// Gets or sets the original release year of the track, if applicable.
/// </summary>
public int? OriginalReleaseYear { get; set; }
/// <summary>
/// Gets or sets the re-release or reissue date of the track, if applicable.
/// </summary>
public DateOnly? ReReleaseDate { get; set; }
/// <summary>
/// Gets or sets the re-release or reissue year of the track, if applicable.
/// </summary>
public int? ReReleaseYear { get; set; }
/// <summary>
/// Gets or sets the country or region of release, if applicable.
/// </summary>
public ReleaseCountry? ReleaseCountry { get; set; }
/// <summary>
/// Gets or sets the release version or edition of the track, if applicable.
/// </summary>
public string? ReleaseVersion { get; set; }
/// <summary>
/// Gets or sets the ISO 639-1 two-letter language code of the track, if applicable.
/// </summary>
public string? LanguageCode { get; set; }
/// <summary>
/// Gets or sets the full name of the language of the track in English, if applicable.
/// </summary>
public string? LanguageName { get; set; }
/// <summary>
/// Gets or sets the native name of the language of the track, if applicable.
/// </summary>
public string? LanguageNativeName { get; set; }
/// <summary>
/// Gets or sets the ISO 639-1 two-letter original language code of the track, if applicable.
/// </summary>
public string? OriginalLanguageCode { get; set; }
/// <summary>
/// Gets or sets the full name of the original language of the track in English, if applicable.
/// </summary>
public string? OriginalLanguageName { get; set; }
/// <summary>
/// Gets or sets the native name of the original language of the track, if applicable.
/// </summary>
public string? OriginalLanguageNativeName { get; set; }
/// <summary>
/// Gets or sets the duration of the audio in seconds.
/// </summary>
public int DurationInSeconds { get; set; }
/// <summary>
/// Gets or sets the sample rate of the audio in Hz.
/// </summary>
public int SampleRate { get; set; }
/// <summary>
/// Gets or sets the number of audio channels.
/// </summary>
public int Channels { get; set; }
/// <summary>
/// Gets or sets the bit depth of the audio, if applicable.
/// </summary>
public int? BitDepth { get; set; }
/// <summary>
/// Gets or sets the audio codec used, if applicable.
/// </summary>
public string? AudioCodec { get; set; }
/// <summary>
/// Gets or sets the container of the audio file, for example MP3, FLAC, OGG, AAC, MP4 or WAV, if applicable.
/// </summary>
public string? Container { get; set; }
/// <summary>
/// Gets or sets the bitrate of the audio in kbps, if applicable.
/// </summary>
public int? Bitrate { get; set; }
/// <summary>
/// Gets or sets the AcoustID fingerprint identifier of the audio file, if applicable.
/// </summary>
public string? AcoustId { get; set; }
/// <summary>
/// Gets or sets the ReplayGain track gain in decibels, if applicable.
/// </summary>
public decimal? ReplayGainTrackGain { get; set; }
/// <summary>
/// Gets or sets the ReplayGain track peak, if applicable.
/// </summary>
public decimal? ReplayGainTrackPeak { get; set; }
/// <summary>
/// Gets or sets the ReplayGain album gain in decibels, if applicable.
/// </summary>
public decimal? ReplayGainAlbumGain { get; set; }
/// <summary>
/// Gets or sets the ReplayGain album peak, if applicable.
/// </summary>
public decimal? ReplayGainAlbumPeak { get; set; }
/// <summary>
/// Gets or sets the number of the track on its disc.
/// </summary>
public int TrackNumber { get; set; }
/// <summary>
/// Gets or sets the number of the disc the track belongs to, if applicable.
/// </summary>
public int? DiscNumber { get; set; }
/// <summary>
/// Gets or sets the script used by the language of the track, if applicable.
/// </summary>
public string? Script { get; set; }
/// <summary>
/// Gets or sets the musical key of the track, if applicable.
/// </summary>
public MusicKey? Key { get; set; }
/// <summary>
/// Gets or sets the tempo of the track in beats per minute, if applicable.
/// </summary>
public int? Bpm { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the recording of the track is a video recording.
/// </summary>
public bool IsVideo { get; set; }
/// <summary>
/// Gets or sets the title of the work the track is a recording of, if applicable.
/// </summary>
public string? WorkTitle { get; set; }
/// <summary>
/// Gets or sets the MusicBrainz type of the work the track is a recording of, if applicable.
/// </summary>
public string? WorkType { get; set; }
/// <summary>
/// Gets or sets the MusicBrainz identifier of the recording, if applicable.
/// </summary>
public Guid? MusicBrainzRecordingId { get; set; }
/// <summary>
/// Gets or sets the MusicBrainz identifier of the track, if applicable.
/// </summary>
public Guid? MusicBrainzTrackId { get; set; }
/// <summary>
/// Gets or sets the MusicBrainz identifier of the work, if applicable.
/// </summary>
public Guid? MusicBrainzWorkId { get; set; }
/// <summary>
/// Gets or sets the album the track belongs to.
/// </summary>
public AlbumEntity? Album { get; set; }
/// <summary>
/// Gets or sets the list of moods of the track.
/// </summary>
public List<TrackMoodEntity> Moods { get; set; } = [];
/// <summary>
/// Gets or sets the list of ISRC (International Standard Recording Code) of the track.
/// </summary>
public List<TrackIsrcEntity> Isrcs { get; set; } = [];
/// <summary>
/// Gets or sets the list of the languages of the work the track is a recording of.
/// </summary>
public List<TrackWorkLanguageEntity> WorkLanguages { get; set; } = [];
/// <summary>
/// Gets or sets the list of ISWC (International Standard Musical Work Code) of the work the track is a recording of.
/// </summary>
public List<TrackWorkIswcEntity> WorkIswcs { get; set; } = [];
/// <summary>
/// Gets or sets the list of the media contributors of the track.
/// </summary>
public List<TrackContributorEntity> Contributors { get; set; } = [];
/// <summary>
/// Gets or sets the list of ratings for this track.
/// </summary>
public List<AudioRatingEntity> Ratings { get; set; } = [];
/// <summary>
/// Gets or sets the genres of the track.
/// </summary>
public HashSet<GenreEntity> Genres { get; set; } = [];
/// <summary>
/// Gets or sets the tags of the track.
/// </summary>
public HashSet<TagEntity> Tags { get; set; } = [];
/// <summary>
/// Gets or sets the status of the metadata enrichment of the track.
/// </summary>
public MetadataStatus MetadataStatus { get; set; }
/// <summary>
/// Gets or sets the date and time when the metadata of the track was last enriched.
/// </summary>
public DateTime? LastMetadataUpdateUtc { get; set; }
/// <summary>
/// Gets or sets the name of the plugin that enriched the metadata of the track.
/// </summary>
public string? MetadataProvider { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the track was deleted by the user and is waiting to be restored or permanently removed.
/// A deleted track is kept out of every catalogue read and is not materialized again by scans, so that an automatic scan never undoes the deletion.
/// </summary>
public bool IsDeleted { get; set; }
/// <summary>
/// Gets or sets the date and time when the track was deleted, or <see langword="null"/> when the track is not deleted.
/// </summary>
public DateTime? DeletedOnUtc { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for an ISRC (International Standard Recording Code) of a track.
/// </summary>
/// <param name="Value">The value of the ISRC.</param>
[DebuggerDisplay("Value: {Value}")]
public record TrackIsrcEntity(
string Value
);
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for a mood of a track.
/// </summary>
/// <param name="Name">The name of the mood.</param>
[DebuggerDisplay("Name: {Name}")]
public record TrackMoodEntity(
string Name
);
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for an ISWC (International Standard Musical Work Code) of the work a track is a recording of.
/// </summary>
/// <param name="Value">The value of the ISWC.</param>
[DebuggerDisplay("Value: {Value}")]
public record TrackWorkIswcEntity(
string Value
);
@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
/// <summary>
/// Repository entity for a language of the work a track is a recording of.
/// </summary>
/// <param name="LanguageCode">The ISO 639-1 two-letter language code.</param>
/// <param name="LanguageName">The full name of the language in English.</param>
/// <param name="NativeName">The native name of the language, if applicable.</param>
[DebuggerDisplay("LanguageCode: {LanguageCode}")]
public record TrackWorkLanguageEntity(
string LanguageCode,
string LanguageName,
string? NativeName
);
@@ -0,0 +1,34 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
/// <summary>
/// Repository entity for a directory scan fingerprint, holding the last write time of a directory of a media library, used to skip the scanning of directories that have not changed since the last scan.
/// </summary>
[DebuggerDisplay("Id: {Id}; Path: {Path}")]
public class DirectoryScanFingerprintEntity : IStorageEntity
{
/// <summary>
/// Gets the Id of the directory scan fingerprint.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the media library to which this directory scan fingerprint belongs.
/// </summary>
public required Guid LibraryId { get; init; }
/// <summary>
/// Gets the path of the directory to which this directory scan fingerprint belongs.
/// </summary>
public required string Path { get; init; }
/// <summary>
/// Gets the last write time of the directory, in UTC, at the moment when the directory was scanned.
/// </summary>
public required DateTime LastWriteTimeUtc { get; init; }
}
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
/// <summary>
/// Repository entity for a media library content location.
/// </summary>
[DebuggerDisplay("Path: {Path}")]
public class LibraryContentLocationEntity
{
/// <summary>
/// Gets or sets the path of the media library content location.
/// </summary>
public required string Path { get; set; }
}
@@ -0,0 +1,145 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
/// <summary>
/// Repository entity for a media library.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class LibraryEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the media library.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the user that owns the media library.
/// </summary>
public required Guid UserId { get; init; }
/// <summary>
/// Gets or sets the title of the media library.
/// </summary>
public required string Title { get; set; }
/// <summary>
/// Gets or sets the path of the image file used as the cover for the library.
/// </summary>
public string? CoverImage { get; set; }
/// <summary>
/// Gets or sets the type of the media library.
/// </summary>
public required LibraryType LibraryType { get; set; }
/// <summary>
/// Gets the list of file system paths that make up the media library.
/// </summary>
public required ICollection<LibraryContentLocationEntity> ContentLocations { get; init; } = [];
/// <summary>
/// Gets the ordered parts of the template describing the structure of the media library on disk.
/// </summary>
public ICollection<LibraryPathTemplatePartEntity> PathTemplateParts { get; init; } = [];
/// <summary>
/// Gets the list of scans of the media library.
/// </summary>
public ICollection<LibraryScanEntity> LibraryScans { get; init; } = [];
/// <summary>
/// Gets whether this media library is enabled or not. A disabled media library is never shown or changed.
/// </summary>
public bool IsEnabled { get; init; }
/// <summary>
/// Gets whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.
/// </summary>
public bool IsLocked { get; init; }
/// <summary>
/// Gets whether this media library should update the metadata of its elements from the web, or not.
/// </summary>
public bool CanDownloadMetadataFromWeb { get; init; }
/// <summary>
/// Gets whether this media library should copy the downloaded metadata into the media library content locations, or not.
/// </summary>
public bool ShouldSaveMetadataInMediaDirectories { get; init; }
/// <summary>
/// Gets or sets whether the unchanged directories are skipped during the scan of the media library.
/// </summary>
public bool ShouldSkipUnchangedDirectoriesDuringScan { get; init; }
/// <summary>
/// Gets whether hidden files and directories are skipped during the scan of the media library.
/// </summary>
public bool ShouldSkipHiddenFilesAndDirectoriesDuringScan { get; init; }
/// <summary>
/// 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.
/// </summary>
public bool IsContentOnSsd { get; init; }
/// <summary>
/// Gets a value indicating whether the consumption progress of the media library items is tracked.
/// </summary>
public bool ShouldTrackConsumptionProgress { get; init; }
/// <summary>
/// Gets the percentage of a media library item that must be consumed for its session to be considered completed, when progress tracking is enabled.
/// </summary>
public int? CompletionThresholdPercentage { get; init; }
/// <summary>
/// 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.
/// </summary>
public string? MetadataProvidersConfigurationFingerprint { get; set; }
/// <summary>
/// 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.
/// </summary>
public string? ArtworkProvidersConfigurationFingerprint { get; set; }
/// <summary>
/// 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.
/// </summary>
public string? PathTemplateFingerprint { get; set; }
/// <summary>
/// Gets the user that owns the media library.
/// </summary>
public UserEntity User { get; init; } = null!;
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
/// <summary>
/// Repository entity for one part of the path template of a media library.
/// </summary>
[DebuggerDisplay("Kind: {Kind}; Position: {Position}")]
public class LibraryPathTemplatePartEntity
{
/// <summary>
/// Gets or sets the zero based position of the part in the path template.
/// </summary>
public required int Position { get; set; }
/// <summary>
/// Gets or sets the kind of the path part.
/// </summary>
public required LibraryPathPartKind Kind { get; set; }
/// <summary>
/// Gets or sets the literal text or the value mask of the path part.
/// </summary>
public required string Representation { get; set; }
/// <summary>
/// Gets or sets whether the path part can be absent from the path.
/// </summary>
public required bool IsOptional { get; set; }
}
@@ -0,0 +1,72 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
/// <summary>
/// Repository entity for a media library scan.
/// </summary>
[DebuggerDisplay("Id: {Id}; Status: {Status}")]
public class LibraryScanEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the media library scan.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the media library that is scanned.
/// </summary>
public required Guid LibraryId { get; init; }
/// <summary>
/// Gets the Id of the user that initiated the media library scan.
/// </summary>
public required Guid UserId { get; init; }
/// <summary>
/// Gets the status of the media library scan.
/// </summary>
public required LibraryScanJobStatus Status { get; init; }
/// <summary>
/// Gets the media library that is scanned.
/// </summary>
public required LibraryEntity Library { get; init; } = null!;
/// <summary>
/// Gets the user that initiated the media library scan.
/// </summary>
public required UserEntity User { get; init; } = null!;
/// <summary>
/// Gets the collection of library scan results of this library scan.
/// </summary>
public ICollection<LibraryScanResultEntity> LibraryScanResults { get; init; } = [];
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,55 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
/// <summary>
/// Repository entity for a media library scan result involving a file.
/// </summary>
[DebuggerDisplay("Id: {Id}; Status: {Status}")]
public class LibraryScanResultEntity : IStorageEntity
{
/// <summary>
/// Gets the Id of the media library scan result.
/// </summary>
public Guid Id { get; init; }
/// <summary>
/// Gets the Id of the scan that this scan result belongs to.
/// </summary>
public required Guid LibraryScanId { get; init; }
/// <summary>
/// Gets the status of the media library scan file.
/// </summary>
public required LibraryScanFileStatus Status { get; init; }
/// <summary>
/// Gets the path of the media library scan file.
/// </summary>
public required string Path { get; init; }
/// <summary>
/// Gets the hash calculated for the media library scan file.
/// </summary>
public required ulong ContentHash { get; init; }
/// <summary>
/// Gets the size of the media library scan file.
/// </summary>
public required long FileSize { get; init; }
/// <summary>
/// Gets the time and date when the file system file was last modified, stored in ticks.
/// </summary>
public required long Ticks { get; init; }
/// <summary>
/// Gets the media library scan that this scan result belongs to.
/// </summary>
public required LibraryScanEntity LibraryScan { get; init; } = null!;
}
@@ -0,0 +1,69 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
/// <summary>
/// Repository entity for a media library item, representing the current state of a previously scanned media item, as a snapshot.
/// </summary>
[DebuggerDisplay("Id: {Id}; Path: {Path}")]
public class LibraryScanSnapshotEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the media library scan snapshot item.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the media library to which this media library scan snapshot item belongs.
/// </summary>
public required Guid LibraryId { get; init; }
/// <summary>
/// Gets the path of the media library scan snapshot item.
/// </summary>
public required string Path { get; init; }
/// <summary>
/// Gets the hash calculated for the media library scan snapshot item.
/// </summary>
public required ulong ContentHash { get; init; }
/// <summary>
/// Gets the size of the media library scan snapshot item, in bytes.
/// </summary>
public required long FileSize { get; init; }
/// <summary>
/// Gets the time and date when the media library scan snapshot item was last modified, stored in ticks.
/// </summary>
public required long Ticks { get; init; }
/// <summary>
/// Gets the media library to which this media library scan snapshot item belongs.
/// </summary>
public required LibraryEntity Library { get; init; } = null!;
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,59 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
/// <summary>
/// Repository entity for a media library scan staging result, holding the file system items discovered during a scan, before they are compared against the media library scan snapshot of the previous scan.
/// </summary>
[DebuggerDisplay("Id: {Id}; Path: {Path}")]
public class LibraryScanStagingResultsEntity : IStorageEntity
{
/// <summary>
/// Gets the Id of the media library scan staging result.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the media library scan that this staging result belongs to.
/// </summary>
public required Guid LibraryScanId { get; init; }
/// <summary>
/// Gets the path of the media library scan staging result.
/// </summary>
public required string Path { get; init; }
/// <summary>
/// Gets the size of the media library scan staging result, in bytes.
/// </summary>
public required long Size { get; init; }
/// <summary>
/// Gets the time and date when the file system item was last modified, stored in ticks.
/// </summary>
public required long Ticks { get; init; }
/// <summary>
/// Gets the hash calculated for the media library scan staging result.
/// </summary>
public required ulong ContentHash { get; init; }
/// <summary>
/// Gets the hash of the same file system item, as stored in the media library scan snapshot of a previous scan, or 0 if the file system item is new.
/// </summary>
public required ulong PreviousContentHash { get; init; }
/// <summary>
/// Gets whether this media library scan staging result represents a file system item that needs its content to be hashed, because it is either new, or it has changed since the previous scan.
/// </summary>
public required bool NeedsRehash { get; init; }
/// <summary>
/// Gets whether this media library scan staging result represents a file system item that was not present in the media library scan snapshot of a previous scan.
/// </summary>
public required bool IsNew { get; init; }
}
@@ -0,0 +1,84 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Repository entity for a piece of artwork of a book, like its cover.
/// A book can have multiple pieces of artwork of different types, and multiple instances of the same type
/// (like the booklet pages of an audio album), each tracked independently so that a change of one artwork
/// does not require the others to be re-fetched.
/// </summary>
[DebuggerDisplay("BookId: {BookId} Type: {ArtworkType} Ordinal: {Ordinal}")]
public class BookArtworkEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the artwork.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the book the artwork belongs to.
/// </summary>
public required Guid BookId { get; set; }
/// <summary>
/// Gets or sets the type of the artwork.
/// </summary>
public required ArtworkType ArtworkType { get; set; }
/// <summary>
/// Gets or sets the ordinal of the artwork within its type, so that multiple artworks of the same type can be ordered.
/// </summary>
public required int Ordinal { get; set; }
/// <summary>
/// Gets or sets the relative file name of the stored artwork, if the artwork has been resolved.
/// </summary>
public string? FileName { get; set; }
/// <summary>
/// Gets or sets the content hash of the stored artwork, used to detect whether a re-resolved artwork differs from the stored one.
/// </summary>
public ulong ContentHash { get; set; }
/// <summary>
/// Gets or sets the status of the artwork enrichment.
/// </summary>
public required ArtworkStatus Status { get; set; }
/// <summary>
/// Gets or sets the name of the plugin that resolved the artwork, if applicable.
/// </summary>
public string? Provider { get; set; }
/// <summary>
/// Gets or sets the date and time when the artwork was last resolved, if applicable.
/// </summary>
public DateTime? LastUpdateUtc { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,56 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Repository entity for the participation of a media contributor in a book, carrying the role the contributor played in that book.
/// The role is tracked per participation, so that a single contributor can play multiple roles in the same book, or different roles in different books.
/// </summary>
[DebuggerDisplay("BookId: {BookId} MediaContributorId: {MediaContributorId}")]
public class BookContributorEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the participation.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the book the contributor participated in.
/// </summary>
public required Guid BookId { get; init; }
/// <summary>
/// Gets the Id of the media contributor.
/// </summary>
public required Guid MediaContributorId { get; init; }
/// <summary>
/// Gets the role the contributor played in the book.
/// </summary>
public required MediaContributorRole Role { get; init; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,260 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.Common;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Repository entity for a book.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class BookEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the media item.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the media library this book belongs to.
/// </summary>
public required Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the file system path of the book.
/// </summary>
public required string Path { get; set; }
/// <summary>
/// Gets or sets the title of the media item.
/// </summary>
public required string Title { get; set; }
/// <summary>
/// Gets or sets the original title of the media item.
/// </summary>
public string? OriginalTitle { get; set; }
/// <summary>
/// Gets or sets the optional description of the media item.
/// </summary>
public string? Description { get; set; }
/// <summary>
/// Gets or sets the optional original release date of the media item.
/// </summary>
public DateOnly? OriginalReleaseDate { get; set; }
/// <summary>
/// Gets or sets the optional original release year of the media item.
/// This is useful when only the year of original release is known.
/// </summary>
public int? OriginalReleaseYear { get; set; }
/// <summary>
/// Gets or sets the optional re-release or reissue date of the media item.
/// </summary>
public DateOnly? ReReleaseDate { get; set; }
/// <summary>
/// Gets or sets the optional re-release or reissue year of the media item.
/// </summary>
public int? ReReleaseYear { get; set; }
/// <summary>
/// Gets or sets the optional country or region of release.
/// </summary>
public ReleaseCountry? ReleaseCountry { get; set; }
/// <summary>
/// Gets or sets the optional release version or edition. (e.g. "Original", "Director's Cut", "2.0").
/// </summary>
public string? ReleaseVersion { get; set; }
/// <summary>
/// Gets or sets the ISO 639-1 two-letter language code.
/// </summary>
public string? LanguageCode { get; set; }
/// <summary>
/// Gets or sets the full name of the language in English.
/// </summary>
public string? LanguageName { get; set; }
/// <summary>
/// Gets or sets an optional native name of the language.
/// </summary>
public string? LanguageNativeName { get; set; }
/// <summary>
/// Gets or sets the optional ISO 639-1 two-letter original language code.
/// </summary>
public string? OriginalLanguageCode { get; set; }
/// <summary>
/// Gets or sets the optional full name of the original language in English.
/// </summary>
public string? OriginalLanguageName { get; set; }
/// <summary>
/// Gets or sets an optional native name of the original language.
/// </summary>
public string? OriginalLanguageNativeName { get; set; }
/// <summary>
/// Gets or sets the list of tags associated with the media item.
/// </summary>
public HashSet<TagEntity> Tags { get; set; } = [];
/// <summary>
/// Gets or sets the list of genres associated with the media item.
/// </summary>
public HashSet<GenreEntity> Genres { get; set; } = [];
/// <summary>
/// Gets or sets the publisher of the written content.
/// </summary>
public string? Publisher { get; set; }
/// <summary>
/// Gets or sets the number of pages in the written content.
/// </summary>
public int? PageCount { get; set; }
/// <summary>
/// Gets or sets the format of the book (e.g., Hardcover, Paperback), if applicable.
/// </summary>
public BookFormat? Format { get; set; }
/// <summary>
/// Gets or sets the edition of the book, if applicable.
/// </summary>
public string? Edition { get; set; }
/// <summary>
/// Gets or sets the volume or book number in the series, if applicable.
/// </summary>
public float? VolumeNumber { get; set; }
// TODO: uncomment when series is implemented.
///// <summary>
///// Gets or sets the series id, if the book is part of a series.
///// </summary>
//public Guid? BookSeriesId { get; set; }
/// <summary>
/// Gets or sets the ASIN (Amazon Standard Identification Number) of the book.
/// </summary>
public string? ASIN { get; set; }
/// <summary>
/// Gets or sets the Goodreads ID of the book.
/// </summary>
public string? GoodreadsId { get; set; }
/// <summary>
/// Gets or sets the Library of Congress Control Number (LCCN) of the book.
/// </summary>
public string? LCCN { get; set; }
/// <summary>
/// Gets or sets the OCLC Number (WorldCat identifier) of the book.
/// </summary>
public string? OCLCNumber { get; set; }
/// <summary>
/// Gets or sets the Open Library ID of the book.
/// </summary>
public string? OpenLibraryId { get; set; }
/// <summary>
/// Gets or sets the LibraryThing ID of the book.
/// </summary>
public string? LibraryThingId { get; set; }
/// <summary>
/// Gets or sets the Google Books ID of the book.
/// </summary>
public string? GoogleBooksId { get; set; }
/// <summary>
/// Gets or sets the Barnes &amp; Noble ID of the book.
/// </summary>
public string? BarnesAndNobleId { get; set; }
/// <summary>
/// Gets or sets the Apple Books ID of the book.
/// </summary>
public string? AppleBooksId { get; set; }
/// <summary>
/// Gets or sets the list of ISBN (International Standard Book Number) of the book.
/// </summary>
public List<IsbnEntity> ISBNs { get; set; } = [];
/// <summary>
/// Gets or sets the participations of the media contributors in the book, each carrying the role the contributor played.
/// </summary>
public List<BookContributorEntity> Contributors { get; set; } = [];
/// <summary>
/// Gets or sets the pieces of artwork of the book, each tracked independently with its own enrichment state.
/// </summary>
public List<BookArtworkEntity> Artwork { get; set; } = [];
/// <summary>
/// Gets or sets the list of ratings for this book.
/// </summary>
public List<BookRatingEntity> Ratings { get; set; } = [];
/// <summary>
/// Gets or sets a value indicating whether the book was deleted by the user and is waiting to be restored or permanently removed.
/// A deleted book is kept out of every catalogue read and is not materialized again by scans, so that an automatic scan never undoes the deletion.
/// </summary>
public bool IsDeleted { get; set; }
/// <summary>
/// Gets or sets the date and time when the book was deleted, or <see langword="null"/> when the book is not deleted.
/// </summary>
public DateTime? DeletedOnUtc { get; set; }
/// <summary>
/// Gets or sets the status of the metadata enrichment of the book.
/// </summary>
public MetadataStatus MetadataStatus { get; set; }
/// <summary>
/// Gets or sets the date and time when the metadata of the book was last enriched.
/// </summary>
public DateTime? LastMetadataUpdateUtc { get; set; }
/// <summary>
/// Gets or sets the name of the plugin that enriched the metadata of the book.
/// </summary>
public string? MetadataProvider { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Repository entity for a book rating.
/// </summary>
/// <param name="Value">The rating value for the book.</param>
/// <param name="MaxValue">The maximum possible rating value for the book.</param>
/// <param name="Source">The source of the book rating (e.g., a specific website or platform).</param>
/// <param name="VoteCount">The number of votes that contributed to the book rating.</param>
[DebuggerDisplay("{Value}/{MaxValue}")]
public record BookRatingEntity(
decimal? Value,
decimal? MaxValue,
BookRatingSource? Source,
int? VoteCount
) : RatingEntity(Value, MaxValue, VoteCount);
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Repository entity for book series.
/// </summary>
/// <param name="Title">The title of the book series.</param>
[DebuggerDisplay("Title: {Title}")]
public record BookSeriesEntity(
string? Title
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Repository entity for ISBN information.
/// </summary>
/// <param name="Value">The ISBN value.</param>
/// <param name="Format">The format of the ISBN (e.g., ISBN-10 or ISBN-13).</param>
[DebuggerDisplay("ISBN: {Value} ({Format})")]
public record IsbnEntity(
string? Value,
IsbnFormat? Format
);
@@ -0,0 +1,80 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.Playlists;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Playlists;
/// <summary>
/// Repository entity for a playlist.
/// </summary>
[DebuggerDisplay("Id: {Id}; Name: {Name}; Type: {Type}")]
public class PlaylistEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the playlist.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the user that owns the playlist.
/// </summary>
public required Guid UserId { get; set; }
/// <summary>
/// Gets or sets the name of the playlist.
/// </summary>
public required string Name { get; set; }
/// <summary>
/// Gets or sets the description of the playlist, if applicable.
/// </summary>
public string? Description { get; set; }
/// <summary>
/// Gets or sets the kind of media the playlist holds.
/// </summary>
public required PlaylistType Type { get; set; }
/// <summary>
/// Gets or sets the ordered entries of the playlist.
/// </summary>
public List<PlaylistEntryEntity> Entries { get; set; } = [];
/// <summary>
/// Gets or sets the number of entries the playlist holds.
/// </summary>
/// <remarks>
/// The count is maintained by the set-based entry operations in the same statement that appends or removes entries and updates the
/// playlist, so reading a window of a very large playlist never has to count its entries.
/// </remarks>
public int EntryCount { get; set; }
/// <summary>
/// Gets or sets the concurrency token of the playlist.
/// </summary>
public long Version { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,64 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.Playlists;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Playlists;
/// <summary>
/// Repository entity for an ordered entry of a playlist.
/// </summary>
/// <remarks>
/// The entry references a media item by its Id and by the kind of media item, without a foreign key, so a playlist survives the deletion
/// of the item it references and the entry can be shown to its owner so that it can be removed.
/// </remarks>
[DebuggerDisplay("Id: {Id}; MediaItemId: {MediaItemId}; MediaItemType: {MediaItemType}; Position: {Position}")]
public class PlaylistEntryEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the entry.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the playlist the entry belongs to.
/// </summary>
public required Guid PlaylistId { get; set; }
/// <summary>
/// Gets or sets the Id of the media item referenced by the entry.
/// </summary>
public required Guid MediaItemId { get; set; }
/// <summary>
/// Gets or sets the kind of media item referenced by the entry.
/// </summary>
public PlaylistMediaItemType MediaItemType { get; set; }
/// <summary>
/// Gets or sets the sparse order key of the entry in the ordered entries of the playlist.
/// </summary>
public long Position { get; set; }
/// <summary>
/// Gets or sets the time and date when the entry was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entry.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entry was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entry.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,59 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Plugins;
/// <summary>
/// Repository entity for the configuration of an artwork provider of a media library.
/// </summary>
[DebuggerDisplay("LibraryId: {LibraryId}; PluginId: {PluginId}")]
public class LibraryArtworkProviderConfigurationEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets or sets the Id of the configuration.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the media library the configuration belongs to.
/// </summary>
public required Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the Id of the plugin providing the artwork.
/// </summary>
public required Guid PluginId { get; set; }
/// <summary>
/// Gets or sets whether the artwork provider is enabled for the media library.
/// </summary>
public required bool IsEnabled { get; set; }
/// <summary>
/// Gets or sets the rank of the artwork provider, determining the order in which providers are tried.
/// </summary>
public required int Rank { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,54 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Plugins;
/// <summary>
/// Repository entity for the configuration of a book reader of a media library.
/// </summary>
[DebuggerDisplay("LibraryId: {LibraryId}; PluginId: {PluginId}")]
public class LibraryBookReaderConfigurationEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets or sets the Id of the configuration.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the media library the configuration belongs to.
/// </summary>
public required Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the Id of the plugin providing the book reader.
/// </summary>
public required Guid PluginId { get; set; }
/// <summary>
/// Gets or sets whether the book reader is enabled for the media library.
/// </summary>
public required bool IsEnabled { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,59 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Plugins;
/// <summary>
/// Repository entity for the configuration of a metadata provider of a media library.
/// </summary>
[DebuggerDisplay("LibraryId: {LibraryId}; PluginId: {PluginId}")]
public class LibraryMetadataProviderConfigurationEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets or sets the Id of the configuration.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the media library the configuration belongs to.
/// </summary>
public required Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the Id of the plugin providing the metadata.
/// </summary>
public required Guid PluginId { get; set; }
/// <summary>
/// Gets or sets whether the metadata provider is enabled for the media library.
/// </summary>
public required bool IsEnabled { get; set; }
/// <summary>
/// Gets or sets the rank of the metadata provider, determining the order in which providers are tried.
/// </summary>
public required int Rank { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,75 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.Plugins;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Plugins;
/// <summary>
/// Repository entity for a plugin.
/// </summary>
[DebuggerDisplay("Name: {Name}")]
public class PluginEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the plugin.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the display name of the plugin.
/// </summary>
public required string Name { get; set; }
/// <summary>
/// Gets or sets the author of the plugin.
/// </summary>
public required string Author { get; set; }
/// <summary>
/// Gets or sets the version of the plugin.
/// </summary>
public required string Version { get; set; }
/// <summary>
/// Gets or sets the description of the plugin.
/// </summary>
public required string Description { get; set; }
/// <summary>
/// Gets or sets the load status of the plugin.
/// </summary>
public PluginLoadStatus LoadStatus { get; set; }
/// <summary>
/// Gets or sets the error message when the plugin failed to load.
/// </summary>
public string? LoadError { get; set; }
/// <summary>
/// Gets or sets the serialized settings of the plugin.
/// </summary>
public string? SettingsJson { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,90 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Scheduling;
/// <summary>
/// Repository entity for a scheduled job.
/// </summary>
[DebuggerDisplay("Id: {Id}; Status: {Status}")]
public class ScheduledJobEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the scheduled job.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the name of the scheduled job.
/// </summary>
public required string Name { get; init; }
/// <summary>
/// Gets the type of the task executed by the scheduled job.
/// </summary>
public required ScheduledTaskType TaskType { get; init; }
/// <summary>
/// Gets the type of the schedule of the scheduled job.
/// </summary>
public required ScheduleType ScheduleType { get; init; }
/// <summary>
/// Gets the interval in minutes of the schedule of the scheduled job, when its <see cref="ScheduleType"/> is <see cref="ScheduleType.WithIntervalInMinutes"/>.
/// </summary>
public int? IntervalMinutes { get; init; }
/// <summary>
/// Gets the hour of the schedule of the scheduled job, when its <see cref="ScheduleType"/> is <see cref="ScheduleType.DailyAtHourAndMinute"/>.
/// </summary>
public int? Hour { get; init; }
/// <summary>
/// Gets the minute of the schedule of the scheduled job, when its <see cref="ScheduleType"/> is <see cref="ScheduleType.DailyAtHourAndMinute"/>.
/// </summary>
public int? Minute { get; init; }
/// <summary>
/// Gets the status of the scheduled job.
/// </summary>
public required ScheduledJobStatus Status { get; init; }
/// <summary>
/// Gets the Id of the user that owns the scheduled job.
/// </summary>
public required Guid OwnerUserId { get; init; }
/// <summary>
/// Gets the optional date and time when the task of the scheduled job last started its execution.
/// </summary>
public DateTime? LastStartedOnUtc { get; init; }
/// <summary>
/// Gets the optional date and time when the task of the scheduled job last completed its execution.
/// </summary>
public DateTime? LastCompletedOnUtc { get; init; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,75 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Scheduling;
/// <summary>
/// Repository entity for an execution of the task of a scheduled job.
/// </summary>
[DebuggerDisplay("Id: {Id}; ScheduledJobId: {ScheduledJobId}")]
public class ScheduledJobExecutionEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the execution of the task of a scheduled job.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the scheduled job whose task was executed.
/// </summary>
public required Guid ScheduledJobId { get; init; }
/// <summary>
/// Gets the type of the task that was executed.
/// </summary>
public required ScheduledTaskType TaskType { get; init; }
/// <summary>
/// Gets a value indicating whether the execution was triggered by the execution cycle of the scheduled job, or it was a one time execution.
/// </summary>
public required bool IsCycleRun { get; init; }
/// <summary>
/// Gets the date and time when the execution started.
/// </summary>
public required DateTime StartedOnUtc { get; init; }
/// <summary>
/// Gets the optional date and time when the execution completed.
/// </summary>
public DateTime? CompletedOnUtc { get; init; }
/// <summary>
/// Gets a value indicating whether the execution cycle of the scheduled job was active when the execution started.
/// </summary>
/// <remarks>
/// A job whose execution cycle is active stays in its active state while a manually fired one time execution runs, so an
/// interrupted execution of such a job must return it to its active state at the next startup; the flag keeps that fact
/// separate from <see cref="IsCycleRun"/>, which records how the execution was triggered for the audit trail.
/// </remarks>
public required bool WasCycleActive { get; init; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,60 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Scheduling;
/// <summary>
/// Repository entity for the display preferences of the scheduler page of a user.
/// </summary>
[DebuggerDisplay("UserId: {UserId}; DisplayTimeSpan: {DisplayTimeSpan}")]
public class SchedulerDisplayPreferencesEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets or sets the Id of the display preferences.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the Id of the user that owns the display preferences.
/// </summary>
public required Guid UserId { get; set; }
/// <summary>
/// Gets or sets the type of the scheduled job tasks whose executions are shown on the scheduler page, or <see langword="null"/> when all of them are shown.
/// </summary>
public ScheduledTaskType? JobTypeFilter { get; set; }
/// <summary>
/// Gets or sets the time span, expressed in <see cref="DisplayTimeUnit"/>, that the scheduler page shows.
/// </summary>
public required int DisplayTimeSpan { get; set; }
/// <summary>
/// Gets or sets the unit in which the displayed time span of the scheduler page is expressed.
/// </summary>
public required SchedulerDisplayTimeUnit DisplayTimeUnit { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,90 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.Themes;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Themes;
/// <summary>
/// Repository entity for a theme.
/// </summary>
[DebuggerDisplay("ThemeId: {ThemeId}; Name: {Name}")]
public class ThemeEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the theme.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets or sets the unique identifier of the theme, taken from its manifest and used by clients to reference it.
/// </summary>
public required string ThemeId { get; set; }
/// <summary>
/// Gets or sets the display name of the theme.
/// </summary>
public required string Name { get; set; }
/// <summary>
/// Gets or sets the description of the theme.
/// </summary>
public required string Description { get; set; }
/// <summary>
/// Gets or sets the author of the theme.
/// </summary>
public required string Author { get; set; }
/// <summary>
/// Gets or sets the version of the theme, using semantic version form.
/// </summary>
public required string Version { get; set; }
/// <summary>
/// Gets or sets the path of the theme preview image, relative to the theme pack root, or <see langword="null"/> when the theme has no preview.
/// </summary>
public string? PreviewPath { get; set; }
/// <summary>
/// Gets or sets the source the theme was installed from.
/// </summary>
public required ThemeInstallSource InstallSource { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this is the currently active theme. At most one theme can be current.
/// </summary>
public bool? IsCurrent { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the theme was soft deleted, so it is not shown and not reinstalled automatically.
/// </summary>
public bool IsDeleted { get; set; }
/// <summary>
/// Gets or sets the UTC timestamp at which the theme was installed.
/// </summary>
public required DateTime InstalledAtUtc { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,87 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Authorization;
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.UsersManagement;
/// <summary>
/// Repository entity for a user.
/// </summary>
[DebuggerDisplay("Username: {Username}")]
public class UserEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the user.
/// </summary>
public Guid Id { get; init; }
/// <summary>
/// Gets or sets the username of the user.
/// </summary>
public required string Username { get; set; }
/// <summary>
/// Gets or sets the hashed password of the user.
/// </summary>
public required string Password { get; set; }
/// <summary>
/// Gets or sets the temporary hashed password used in password recovery.
/// </summary>
public string? TempPassword { get; set; }
/// <summary>
/// Gets or sets the optional Time-based One-Time Password (TOTP) secret for two-factor authentication.
/// </summary>
public string? TotpSecret { get; set; }
/// <summary>
/// Gets or sets the date and time when the temporary password used in password recovery was created.
/// </summary>
public DateTime? TempPasswordCreated { get; set; }
/// <summary>
/// Gets the collection of libraries owned by this user.
/// </summary>
public ICollection<LibraryEntity> Libraries { get; init; } = [];
/// <summary>
/// Gets the collection of library scans initiated by this user.
/// </summary>
public ICollection<LibraryScanEntity> LibraryScans { get; init; } = [];
/// <summary>
/// Gets the user roles association that includes this user.
/// </summary>
public required UserRoleEntity? UserRole { get; init; }
/// <summary>
/// Gets the collection of user permission associations that include this user.
/// </summary>
public required ICollection<UserPermissionEntity> UserPermissions { get; init; } = [];
/// <summary>
/// Gets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}
@@ -0,0 +1,168 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Domain.SharedKernel.Common.Enums.Playback;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.UsersManagement;
/// <summary>
/// Repository entity for the settings of a user.
/// </summary>
[DebuggerDisplay("Id: {Id}; UserId: {UserId}")]
public class UserSettingsEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of these user settings.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the user that owns these settings.
/// </summary>
public required Guid UserId { get; init; }
/// <summary>
/// Gets or sets whether pagination is enabled for the user, or not.
/// </summary>
public bool IsPaginationEnabled { get; set; }
/// <summary>
/// Gets or sets the number of library items displayed per page when pagination is enabled.
/// </summary>
public int ItemsPerPage { get; set; }
/// <summary>
/// Gets or sets whether the "The" prefix of library item titles is ignored by the alpha picker, or not.
/// </summary>
public bool ShouldIgnoreThePrefixForAlphaPicker { get; set; }
/// <summary>
/// Gets or sets whether the theme data served to this user is cached, or not.
/// </summary>
public bool IsThemeCachingEnabled { get; set; } = true;
/// <summary>
/// Gets or sets whether the metadata of the media library items is aggregated from multiple providers, when fields are missing, or not.
/// </summary>
public bool ShouldAggregateMetadataWhenMissing { get; set; }
/// <summary>
/// Gets or sets whether the artwork of the media library items is aggregated from multiple providers, when it is missing, or not.
/// </summary>
public bool ShouldAggregateArtworkWhenMissing { get; set; }
/// <summary>
/// Gets or sets whether PDF books are rendered as page images for the user, or not. Rendering PDFs as images preserves the
/// original layout, but the pages are not selectable or searchable, unlike their text layer.
/// </summary>
public bool ShouldRenderPdfAsImages { get; set; }
/// <summary>
/// Gets or sets whether the styles of the book content are preserved when it is rendered for the user, or not. Preserving them
/// keeps the original look of a book (its fonts, colors, and alignment), but the styles of a book can load resources from
/// external servers, which those servers could observe; stripping them removes that possibility, at the cost of the look of the book.
/// </summary>
public bool ShouldPreserveBookStyles { get; set; }
/// <summary>
/// Gets or sets whether the player keeps downloading a track while playback is paused, or not, up to the entire file.
/// </summary>
public bool ShouldKeepDownloadingWhilePaused { get; set; } = true;
/// <summary>
/// Gets or sets whether the player continues playback at the end of an album or artist, or not.
/// </summary>
public bool ShouldAutoplay { get; set; } = true;
/// <summary>
/// Gets or sets whether the player transitions between consecutive tracks without a gap, or not.
/// </summary>
public bool IsGaplessPlaybackEnabled { get; set; } = true;
/// <summary>
/// Gets or sets the way ReplayGain normalization is applied to the tracks the user plays.
/// </summary>
public ReplayGainMode ReplayGainMode { get; set; }
/// <summary>
/// Gets or sets the quality cap applied to the audio the server normalizes for the user.
/// </summary>
public PlaybackStreamingQuality StreamingQuality { get; set; }
/// <summary>
/// Gets or sets the direction in which each channel of the VU meter of the audio player grows.
/// </summary>
public VuMeterOrientation VuMeterOrientation { get; set; }
/// <summary>
/// Gets or sets the number of segments each channel of the VU meter is divided into.
/// </summary>
public int VuMeterSegmentCount { get; set; } = 12;
/// <summary>
/// Gets or sets the gap, in pixels, between the segments and the channels of the VU meter.
/// </summary>
public int VuMeterSegmentGap { get; set; } = 1;
/// <summary>
/// Gets or sets the level, between 0 and 1, above which a segment of the VU meter is drawn with its medium state.
/// </summary>
public double VuMeterMediumThreshold { get; set; } = 0.6;
/// <summary>
/// Gets or sets the level, between 0 and 1, above which a segment of the VU meter is drawn with its high state.
/// </summary>
public double VuMeterHighThreshold { get; set; } = 0.8;
/// <summary>
/// Gets or sets whether the VU meter holds the peak level of each channel after it falls, or not.
/// </summary>
public bool VuMeterShowPeak { get; set; } = true;
/// <summary>
/// Gets or sets the time, in milliseconds, a peak of the VU meter is held before it starts falling.
/// </summary>
public int VuMeterPeakHoldDurationInMilliseconds { get; set; } = 650;
/// <summary>
/// Gets or sets the number of level units the display of the VU meter falls per second when the input level drops.
/// </summary>
public double VuMeterReleasePerSecond { get; set; } = 3.0;
/// <summary>
/// Gets or sets the number of level units the peak of the VU meter falls per second after its hold time elapsed.
/// </summary>
public double VuMeterPeakReleasePerSecond { get; set; } = 0.65;
/// <summary>
/// Gets or sets the last volume the player reported for the user. Written automatically by the player, and not part of the settings the user edits.
/// </summary>
public double Volume { get; set; } = 1.0;
/// <summary>
/// Gets or sets the last mute state the player reported for the user. Written automatically by the player, and not part of the settings the user edits.
/// </summary>
public bool IsMuted { get; set; }
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public Guid? UpdatedBy { get; set; }
}