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,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
);