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,8 @@
namespace Lumina.Application.Common.CQRS;
/// <summary>
/// Marker interface for command types handled by <see cref="ICommandHandler{TCommand, TResult}"/>.
/// </summary>
public interface ICommand
{
}
@@ -0,0 +1,23 @@
#region ========================================================================= USING =====================================================================================
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Application.Common.CQRS;
/// <summary>
/// Defines a contract for handling commands in the application layer.
/// Commands represent operations that modify application state.
/// </summary>
/// <typeparam name="TCommand">The type of command to handle.</typeparam>
/// <typeparam name="TResult">The type of result returned after handling the command.</typeparam>
public interface ICommandHandler<in TCommand, TResult> where TCommand : ICommand
{
/// <summary>
/// Handles the specified command and returns a result.
/// </summary>
/// <param name="command">The command to handle.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation, containing the result of the command execution.</returns>
Task<TResult> HandleAsync(TCommand command, CancellationToken cancellationToken = default);
}
@@ -0,0 +1,8 @@
namespace Lumina.Application.Common.CQRS;
/// <summary>
/// Marker interface for query types handled by <see cref="IQueryHandler{TQuery, TResult}"/>.
/// </summary>
public interface IQuery
{
}
@@ -0,0 +1,23 @@
#region ========================================================================= USING =====================================================================================
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Application.Common.CQRS;
/// <summary>
/// Defines a contract for handling queries in the application layer.
/// Queries represent read-only operations that retrieve data without modifying application state.
/// </summary>
/// <typeparam name="TQuery">The type of query to handle.</typeparam>
/// <typeparam name="TResult">The type of result returned after handling the query.</typeparam>
public interface IQueryHandler<in TQuery, TResult> where TQuery : IQuery
{
/// <summary>
/// Handles the specified query and returns a result.
/// </summary>
/// <param name="query">The query to handle.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation, containing the result of the query execution.</returns>
Task<TResult> HandleAsync(TQuery query, CancellationToken cancellationToken = default);
}
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.Favorites;
/// <summary>
/// Data transfer object for the generic display data of a favorited media item.
/// </summary>
/// <remarks>
/// For a music artist the title is the artist name and there is no collection or creator. For a music album the title is the album title,
/// there is no collection, and the creator is the artist. For a music track the title is the track title, the collection is the album and
/// the creator is the artist. For a book the title is the book title, there is no collection yet because the series of a book is not catalogued, and the creator is its
/// first author.
/// </remarks>
/// <param name="LibraryId">The Id of the media library that contains the media item.</param>
/// <param name="Title">The title of the media item.</param>
/// <param name="CollectionId">The Id of the collection that contains the media item, or an empty Guid when there is none.</param>
/// <param name="CollectionTitle">The title of the collection that contains the media item, or an empty string when there is none.</param>
/// <param name="CreatorId">The Id of the creator of the media item, or an empty Guid when there is none.</param>
/// <param name="CreatorName">The name of the creator of the media item, or an empty string when there is none.</param>
/// <param name="CoverPath">The path of the cover art of the media item, if available.</param>
[DebuggerDisplay("LibraryId: {LibraryId}; Title: {Title}")]
public sealed record FavoriteItemDisplayDto(
Guid LibraryId,
string Title,
Guid CollectionId,
string CollectionTitle,
Guid CreatorId,
string CreatorName,
string? CoverPath
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Favorites;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.Favorites;
/// <summary>
/// Data transfer object for a stored favorite together with the display data of the media item it references.
/// </summary>
/// <param name="Favorite">The stored favorite.</param>
/// <param name="Display">The display data of the referenced media item, or <see langword="null"/> when it no longer exists.</param>
[DebuggerDisplay("Id: {Favorite.Id}; MediaKind: {Favorite.MediaKind}")]
public sealed record FavoriteItemDto(
FavoriteEntity Favorite,
FavoriteItemDisplayDto? Display
);
@@ -0,0 +1,12 @@
namespace Lumina.Application.Common.DTO.Filtering;
/// <summary>
/// Data transfer object that defines common filter properties used when querying paginated data. Implementations may add additional properties specific to their module or domain.
/// </summary>
public record BaseFilterDto
{
/// <summary>
/// The search term used to filter results.
/// </summary>
public string? SearchTerm { get; init; }
}
@@ -0,0 +1,29 @@
#region ========================================================================= USING =====================================================================================
using System;
#endregion
namespace Lumina.Application.Common.DTO.Filtering;
/// <summary>
/// Data transfer object that represents the parameters required to filter by library data.
/// </summary>
public record LibraryFilterDto : BaseFilterDto
{
/// <summary>
/// The Id of the media library used to filter data.
/// </summary>
public required Guid LibraryId { get; init; }
/// <summary>
/// The alpha key used to filter the data by the first character of the item title, for the alpha picker.
/// Can be <see langword="null"/> to disable alpha filtering, a single ASCII letter (case-insensitive) to filter by that letter,
/// <see cref="LibraryItemAlphaKeys.NUMBER"/> to filter by titles whose first character is a digit,
/// or <see cref="LibraryItemAlphaKeys.SYMBOL"/> to filter by titles whose first character is neither a letter nor a digit.
/// </summary>
public string? FilterAlphaKey { get; init; }
/// <summary>
/// Whether the leading "The " prefix of a title should be ignored when computing the alpha key, or not.
/// </summary>
public bool ShouldIgnoreThePrefixForAlphaPicker { get; init; }
}
@@ -0,0 +1,20 @@
#region ========================================================================= USING =====================================================================================
#endregion
namespace Lumina.Application.Common.DTO.Filtering;
/// <summary>
/// Collection of the special alpha keys that can be used for alpha filtering, in addition to the single letters.
/// </summary>
public static class LibraryItemAlphaKeys
{
/// <summary>
/// The alpha key that filters the items by titles whose first character is a digit.
/// </summary>
public const string NUMBER = "#";
/// <summary>
/// The alpha key that filters the items by titles whose first character is neither a letter nor a digit.
/// </summary>
public const string SYMBOL = "*";
}
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for the consumption statistics of every user, together with their combined totals.
/// </summary>
/// <param name="Total">The combined consumption statistics of every user.</param>
/// <param name="Users">The consumption statistics of each user.</param>
[DebuggerDisplay("UserCount: {Users.Count}; CountedSessionCount: {Total.CountedSessionCount}")]
public sealed record AllUsersConsumptionStatisticsDto(
ConsumptionTotalsDto Total,
IReadOnlyList<ConsumptionStatisticsDto> Users
);
@@ -0,0 +1,38 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for a media item of the consumption history, together with its aggregated consumption counts and display details.
/// </summary>
/// <param name="MediaKind">The kind of the consumed media item.</param>
/// <param name="MediaItemId">The Id of the consumed media item.</param>
/// <param name="LibraryId">The Id of the media library that contains the media item.</param>
/// <param name="IsAvailable">Whether the media item still exists and can be accessed by the user. When <see langword="false"/>, the title, collection title, creator name, and cover path are blank, while the identity and aggregation fields remain.</param>
/// <param name="Title">The title of the media item, or an empty string when the item is not available.</param>
/// <param name="CollectionTitle">The title of the collection that contains the media item, or an empty string when there is none.</param>
/// <param name="CreatorName">The name of the creator of the media item, or an empty string when there is none.</param>
/// <param name="CoverPath">The path of the cover art of the media item, if available.</param>
/// <param name="LastConsumedOnUtc">The date and time when the media item was last consumed.</param>
/// <param name="CountedSessionCount">The number of consumption sessions of the media item that count towards statistics.</param>
/// <param name="CompletedSessionCount">The number of consumption sessions of the media item that completed.</param>
/// <param name="ConsumedDurationMilliseconds">The active duration consumed in the media item, over all of its sessions, in milliseconds.</param>
[DebuggerDisplay("MediaKind: {MediaKind}; MediaItemId: {MediaItemId}; CountedSessionCount: {CountedSessionCount}")]
public sealed record ConsumedItemDto(
MediaKind MediaKind,
Guid MediaItemId,
Guid LibraryId,
bool IsAvailable,
string Title,
string CollectionTitle,
string CreatorName,
string? CoverPath,
DateTime LastConsumedOnUtc,
int CountedSessionCount,
int CompletedSessionCount,
long ConsumedDurationMilliseconds
);
@@ -0,0 +1,39 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaConsumption;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for a media consumption session.
/// </summary>
/// <param name="Id">The Id of the consumption record.</param>
/// <param name="LibraryId">The Id of the media library that contains the consumed media item.</param>
/// <param name="MediaItemId">The Id of the consumed media item.</param>
/// <param name="MediaKind">The kind of media that was consumed.</param>
/// <param name="Status">The state of the consumption session.</param>
/// <param name="StartedOnUtc">The date and time when the session started.</param>
/// <param name="LastActivityOnUtc">The date and time when the session last received activity.</param>
/// <param name="EndedOnUtc">The date and time when the session completed or stopped, if it has ended.</param>
/// <param name="ConsumedDurationMilliseconds">The active duration consumed by the session, in milliseconds.</param>
/// <param name="LastPosition">The last known position for the media item, if any.</param>
/// <param name="LastProgressFraction">The latest reported progress fraction of the media item.</param>
/// <param name="ConsecutivePagesRead">The number of consecutive pages read in the session.</param>
[DebuggerDisplay("Id: {Id}; MediaKind: {MediaKind}; Status: {Status}")]
public sealed record ConsumptionRecordDto(
Guid Id,
Guid LibraryId,
Guid MediaItemId,
MediaKind MediaKind,
ConsumptionStatus Status,
DateTime StartedOnUtc,
DateTime LastActivityOnUtc,
DateTime? EndedOnUtc,
long ConsumedDurationMilliseconds,
MediaPositionDto? LastPosition,
double LastProgressFraction,
int ConsecutivePagesRead
);
@@ -0,0 +1,28 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for the consumption statistics of a user.
/// </summary>
/// <param name="UserId">The Id of the user the statistics belong to.</param>
/// <param name="TotalConsumedDurationMilliseconds">The total duration consumed over every recorded session, in milliseconds.</param>
/// <param name="CountedSessionCount">The number of recorded sessions that count towards statistics.</param>
/// <param name="CompletedSessionCount">The number of recorded sessions that completed.</param>
/// <param name="StoppedSessionCount">The number of recorded sessions that stopped before they completed and count towards statistics.</param>
/// <param name="CompletionRate">The fraction of the counted sessions that completed, between 0 and 1, or 0 when there is no counted session.</param>
/// <param name="MediaKindSummaries">The consumption statistics broken down by media kind.</param>
[DebuggerDisplay("UserId: {UserId}; CountedSessionCount: {CountedSessionCount}")]
public sealed record ConsumptionStatisticsDto(
Guid UserId,
long TotalConsumedDurationMilliseconds,
int CountedSessionCount,
int CompletedSessionCount,
int StoppedSessionCount,
double CompletionRate,
IReadOnlyList<MediaKindConsumptionStatisticsDto> MediaKindSummaries
);
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for the combined consumption statistics of every user.
/// </summary>
/// <param name="TotalConsumedDurationMilliseconds">The total duration consumed over every recorded session of every user, in milliseconds.</param>
/// <param name="CountedSessionCount">The number of recorded sessions of every user that count towards statistics.</param>
/// <param name="CompletedSessionCount">The number of recorded sessions of every user that completed.</param>
/// <param name="StoppedSessionCount">The number of recorded sessions of every user that stopped before they completed and count towards statistics.</param>
/// <param name="CompletionRate">The fraction of the counted sessions of every user that completed, between 0 and 1, or 0 when there is no counted session.</param>
/// <param name="MediaKindSummaries">The combined consumption statistics broken down by media kind.</param>
[DebuggerDisplay("CountedSessionCount: {CountedSessionCount}; CompletedSessionCount: {CompletedSessionCount}")]
public sealed record ConsumptionTotalsDto(
long TotalConsumedDurationMilliseconds,
int CountedSessionCount,
int CompletedSessionCount,
int StoppedSessionCount,
double CompletionRate,
IReadOnlyList<MediaKindConsumptionStatisticsDto> MediaKindSummaries
);
@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for the consumption statistics of a genre, grouped across media kinds.
/// </summary>
/// <param name="Name">The lowercase name of the genre.</param>
/// <param name="ConsumedItemCount">The number of distinct media items that carry the genre and were consumed.</param>
/// <param name="ConsumedDurationMilliseconds">The active duration consumed in the media items that carry the genre, in milliseconds.</param>
[DebuggerDisplay("Name: {Name}; ConsumedItemCount: {ConsumedItemCount}")]
public sealed record GenreConsumptionDto(
string Name,
int ConsumedItemCount,
long ConsumedDurationMilliseconds
);
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for the consumption statistics of a user for one kind of media.
/// </summary>
/// <param name="MediaKind">The kind of media the statistics belong to.</param>
/// <param name="TotalConsumedDurationMilliseconds">The total duration consumed over every recorded session of the media kind, in milliseconds.</param>
/// <param name="CountedSessionCount">The number of recorded sessions of the media kind that count towards statistics.</param>
/// <param name="CompletedSessionCount">The number of recorded sessions of the media kind that completed.</param>
/// <param name="StoppedSessionCount">The number of recorded sessions of the media kind that stopped before they completed and count towards statistics.</param>
/// <param name="CompletionRate">The fraction of the counted sessions of the media kind that completed, between 0 and 1, or 0 when there is no counted session.</param>
[DebuggerDisplay("MediaKind: {MediaKind}; CountedSessionCount: {CountedSessionCount}")]
public sealed record MediaKindConsumptionStatisticsDto(
MediaKind MediaKind,
long TotalConsumedDurationMilliseconds,
int CountedSessionCount,
int CompletedSessionCount,
int StoppedSessionCount,
double CompletionRate
);
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaConsumption;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for a position reached in a media item during a consumption session.
/// </summary>
/// <param name="Kind">The kind of representation used by the position.</param>
/// <param name="TimeOffsetMilliseconds">The position within the media item, in milliseconds, when the position is a time offset.</param>
/// <param name="Location">The opaque locator within the media item, when the position is not a time offset.</param>
[DebuggerDisplay("Kind: {Kind}; TimeOffsetMilliseconds: {TimeOffsetMilliseconds}")]
public sealed record MediaPositionDto(
MediaPositionKind Kind,
long? TimeOffsetMilliseconds,
string? Location
);
@@ -0,0 +1,28 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for the point at which a user can resume consuming a media item.
/// </summary>
/// <param name="Id">The Id of the resume point.</param>
/// <param name="LibraryId">The Id of the media library that contains the media item.</param>
/// <param name="MediaItemId">The Id of the media item to resume.</param>
/// <param name="MediaKind">The kind of media that is resumed.</param>
/// <param name="LastPosition">The position at which the media item can be resumed.</param>
/// <param name="LastProgressFraction">The progress fraction at which the media item can be resumed.</param>
/// <param name="LastConsumedOnUtc">The date and time when the media item was last consumed.</param>
[DebuggerDisplay("Id: {Id}; MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")]
public sealed record ResumePointDto(
Guid Id,
Guid LibraryId,
Guid MediaItemId,
MediaKind MediaKind,
MediaPositionDto LastPosition,
double LastProgressFraction,
DateTime LastConsumedOnUtc
);
@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for the consumption statistics of a tag, grouped across media kinds.
/// </summary>
/// <param name="Name">The lowercase name of the tag.</param>
/// <param name="ConsumedItemCount">The number of distinct media items that carry the tag and were consumed.</param>
/// <param name="ConsumedDurationMilliseconds">The active duration consumed in the media items that carry the tag, in milliseconds.</param>
[DebuggerDisplay("Name: {Name}; ConsumedItemCount: {ConsumedItemCount}")]
public sealed record TagConsumptionDto(
string Name,
int ConsumedItemCount,
long ConsumedDurationMilliseconds
);
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using System;
using System.Collections.Generic;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
/// <summary>
/// Lightweight read model of an album, containing only the fields needed to display the album in a card-based grid or a list.
/// </summary>
/// <param name="Id">The Id of the album.</param>
/// <param name="Title">The title of the album.</param>
/// <param name="TotalTracks">The number of tracks of the release.</param>
/// <param name="CoverPath">The path of the image representing the album, if available.</param>
/// <param name="ReleaseYear">The release year of the album (the re-release year, if available, or the original release year), if known.</param>
/// <param name="ReleaseTypes">The set of types of the release.</param>
public sealed record AlbumLiteRow(
Guid Id,
string Title,
int TotalTracks,
string? CoverPath,
int? ReleaseYear,
List<MusicReleaseType>? ReleaseTypes
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
/// <summary>
/// Lightweight read model of an artist, containing only the fields needed to display the artist in a card-based grid or a list.
/// </summary>
/// <param name="Id">The Id of the artist.</param>
/// <param name="Name">The name of the artist.</param>
/// <param name="CoverPath">The path of the image representing the artist, if available.</param>
public sealed record ArtistLiteRow(
Guid Id,
string Name,
string? CoverPath
);
@@ -0,0 +1,34 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.Playback;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Playback;
/// <summary>
/// Data transfer object for the normalized audio of a track, produced and cached as a sequence of fixed duration segments.
/// </summary>
/// <param name="TrackId">The Id of the track whose audio the cached entry holds, so the caller can verify that the entry is the one it authorized.</param>
/// <param name="CacheId">The opaque identifier of the cached entry that holds the normalized audio.</param>
/// <param name="Mode">The way the audio is delivered, which is a remux or a transcode.</param>
/// <param name="Container">The container of the delivered audio.</param>
/// <param name="Codec">The codec of the delivered audio.</param>
/// <param name="SegmentDurationSeconds">The duration of each segment of the delivered audio, in seconds.</param>
/// <param name="DurationInSeconds">
/// The duration of the produced and cached audio, in seconds, rounded up to the next second. It is the produced end rather than the probed duration, so
/// it always covers every produced segment.
/// </param>
/// <param name="Segments">The segments that make up the delivered audio, in playback order.</param>
[DebuggerDisplay("TrackId: {TrackId} CacheId: {CacheId} Container: {Container} Codec: {Codec}")]
public sealed record NormalizedTrackDto(
Guid TrackId,
string CacheId,
PlaybackDeliveryMode Mode,
string Container,
string Codec,
int SegmentDurationSeconds,
int DurationInSeconds,
IReadOnlyList<NormalizedTrackSegmentDto> Segments
);
@@ -0,0 +1,52 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.Playback;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Playback;
/// <summary>
/// Data transfer object for the request to produce the normalized audio of a track, as the delivery decision of a playback manifest describes it.
/// </summary>
/// <param name="TrackId">The Id of the track whose audio is normalized. It binds the produced cache entry to the track the caller authorized.</param>
/// <param name="UserId">The Id of the user whose request starts the production. It is used for the per-user admission limit, and never for the cache identity.</param>
/// <param name="SourcePath">The file system path of the stored audio file of the track.</param>
/// <param name="AllowedRoots">
/// The content locations the source path is allowed to be inside. The service validates the path against them and re-checks it after opening, so a
/// caller that forgets to enforce containment cannot hand an arbitrary path to the transcoder.
/// </param>
/// <param name="SourceContainer">The container of the stored audio file, as captured by the probe, used to pin the ffmpeg demuxer.</param>
/// <param name="Mode">The way the audio is delivered, which is a remux or a transcode.</param>
/// <param name="Container">The container of the delivered audio, as chosen by the delivery decision.</param>
/// <param name="Codec">The codec of the delivered audio, as chosen by the delivery decision.</param>
/// <param name="SegmentDurationSeconds">The duration of each segment of the delivered audio, in seconds.</param>
/// <param name="DurationInSeconds">The duration of the audio of the track, in seconds.</param>
/// <param name="Bitrate">The stored audio bitrate of the track, in kbps, used to estimate a remux of a lossy codec.</param>
/// <param name="SampleRate">The sample rate of the stored audio of the track, in Hz, used to estimate the size of a lossless delivery.</param>
/// <param name="Channels">The number of audio channels of the track, used to estimate the size of a lossless delivery.</param>
/// <param name="BitDepth">The bit depth of the stored audio of the track, if applicable, used to estimate the size of a lossless delivery.</param>
/// <param name="Quality">The quality cap applied to the delivered audio when it has to be re-encoded.</param>
/// <param name="SourceLength">The length the source file had when the delivery was declared, in bytes. The production is rejected when the file no longer matches.</param>
/// <param name="SourceLastModifiedUtc">The last modification time the source file had when the delivery was declared. The production is rejected when the file no longer matches.</param>
[DebuggerDisplay("TrackId: {TrackId} Mode: {Mode} Container: {Container} Codec: {Codec}")]
public sealed record NormalizedTrackRequestDto(
Guid TrackId,
Guid UserId,
string SourcePath,
IReadOnlyList<string> AllowedRoots,
string? SourceContainer,
PlaybackDeliveryMode Mode,
string Container,
string Codec,
int SegmentDurationSeconds,
int DurationInSeconds,
int? Bitrate,
int SampleRate,
int Channels,
int? BitDepth,
PlaybackStreamingQuality Quality,
long SourceLength,
DateTime SourceLastModifiedUtc
);
@@ -0,0 +1,29 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
using System.IO;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Playback;
/// <summary>
/// Data transfer object for a single produced segment of the normalized audio of a track, ready to be written to the response.
/// </summary>
/// <remarks>
/// The segment owns a live stream over a leased cache entry, so it is an internal delivery object of the API rather than a serializable
/// contract. The caller must dispose the stream once the response is written, which releases the cache reader lease.
/// </remarks>
/// <param name="Content">The read stream over the segment, which the caller owns and must release once the response is written.</param>
/// <param name="Length">The length of the segment, in bytes, taken from the index of the normalized audio.</param>
/// <param name="StartSeconds">The exact start of the segment on the track timeline, in seconds, taken from the index of the normalized audio.</param>
/// <param name="Container">The container of the delivered audio, used to resolve the media type of the segment.</param>
/// <param name="SegmentCount">The number of segments the production holds, so the caller can tell the end of the audio from a missing segment.</param>
/// <param name="DurationInSeconds">The duration of the produced normalized audio, in seconds, which can differ from the probed duration.</param>
[DebuggerDisplay("Length: {Length} StartSeconds: {StartSeconds} Container: {Container} SegmentCount: {SegmentCount}")]
public sealed record NormalizedTrackSegmentDataDto(
Stream Content,
long Length,
decimal StartSeconds,
string Container,
int SegmentCount,
int DurationInSeconds
);
@@ -0,0 +1,20 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Playback;
/// <summary>
/// Data transfer object for a single fixed duration segment of the normalized audio of a track.
/// </summary>
/// <param name="Index">The zero based position of the segment in the delivered audio.</param>
/// <param name="StartSeconds">The time, in seconds from the start of the track, at which the segment starts.</param>
/// <param name="DurationSeconds">The duration of the segment, in seconds.</param>
/// <param name="Length">The length of the segment, in bytes.</param>
[DebuggerDisplay("Index: {Index} StartSeconds: {StartSeconds} DurationSeconds: {DurationSeconds}")]
public sealed record NormalizedTrackSegmentDto(
int Index,
decimal StartSeconds,
decimal DurationSeconds,
long Length
);
@@ -0,0 +1,16 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Playback;
/// <summary>
/// Data transfer object for a single container and codec combination that a player advertises it can demux and decode directly.
/// </summary>
/// <param name="Container">The container the player can demux, for example MP3, FLAC, OGG, WAV or MP4.</param>
/// <param name="Codec">The codec the player can decode, for example MP3, FLAC, Opus, Vorbis, PCM or AAC.</param>
[DebuggerDisplay("Container: {Container} Codec: {Codec}")]
public sealed record PlaybackCapabilityDto(
string Container,
string Codec
);
@@ -0,0 +1,23 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.Playback;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Playback;
/// <summary>
/// Data transfer object for the decision of how the audio of a track is delivered to a player: as the original file, as the same codec repackaged, or re-encoded.
/// </summary>
/// <param name="Mode">The way the audio is delivered.</param>
/// <param name="Container">The container of the delivered audio, which is the stored container of the track for a direct play.</param>
/// <param name="Codec">The codec of the delivered audio, which is the stored codec of the track for a direct play.</param>
/// <param name="Shape">The shape the delivered audio is addressed and seeked by.</param>
/// <param name="SegmentDurationSeconds">The duration of each segment of the delivered audio, in seconds, or zero when the shape is not time addressed.</param>
[DebuggerDisplay("Mode: {Mode} Container: {Container} Codec: {Codec} Shape: {Shape}")]
public sealed record PlaybackDeliveryDecisionDto(
PlaybackDeliveryMode Mode,
string Container,
string Codec,
PlaybackDeliveryShape Shape,
int SegmentDurationSeconds
);
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.Playback;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Playback;
/// <summary>
/// Data transfer object for the delivery a playback manifest issued to a user. It composes the exact normalization request the delivery declares,
/// so a new production input is added in one place and can never drift between the cache identity and the handle.
/// </summary>
/// <param name="Request">The complete normalization request the delivery declares, including its user, track, decision, quality and source identity.</param>
/// <param name="Shape">The shape the delivered audio is addressed by, which must be time addressed segments for a segment route.</param>
/// <param name="LibraryId">The Id of the library the track belongs to, so the segment route can scope the delivery without querying it again.</param>
/// <param name="AlbumId">The Id of the album the track belongs to, so the segment route can scope the delivery without querying it again.</param>
/// <param name="ArtistId">The Id of the artist that owns the album, so the segment route can scope the delivery without querying it again.</param>
[DebuggerDisplay("TrackId: {Request.TrackId} Mode: {Request.Mode} Container: {Request.Container} Codec: {Request.Codec}")]
public sealed record PlaybackDeliveryHandleDto(
NormalizedTrackRequestDto Request,
PlaybackDeliveryShape Shape,
Guid LibraryId,
Guid AlbumId,
Guid ArtistId
);
@@ -0,0 +1,16 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Playback;
/// <summary>
/// Data transfer object for the stored format of a track's audio, that a playback delivery decision is made on.
/// </summary>
/// <param name="Container">The container of the audio file of the track, for example MP3, FLAC, OGG, MP4 or WAV.</param>
/// <param name="Codec">The codec of the audio of the track, as reported by the probe, for example AAC, FLAC, Opus or PCM.</param>
[DebuggerDisplay("Container: {Container} Codec: {Codec}")]
public sealed record PlaybackSourceFormatDto(
string? Container,
string? Codec
);
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using System;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Read model of a track returned by a randomized shuffle query, carrying everything the client needs to queue and play it.
/// </summary>
/// <param name="TrackId">The Id of the track.</param>
/// <param name="Title">The title of the track.</param>
/// <param name="DurationInSeconds">The duration of the track in seconds.</param>
/// <param name="AlbumId">The Id of the album the track belongs to.</param>
/// <param name="AlbumTitle">The title of the album the track belongs to.</param>
/// <param name="ArtistId">The Id of the artist the album belongs to.</param>
/// <param name="CoverPath">The path of the cover of the album, if available.</param>
public sealed record ShuffleTrackRowDto(
Guid TrackId,
string Title,
int DurationInSeconds,
Guid AlbumId,
string AlbumTitle,
Guid ArtistId,
string? CoverPath
);
@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Data transfer object for the access information of a set of existing tracks.
/// </summary>
/// <param name="TrackCount">The number of distinct requested tracks that exist.</param>
/// <param name="LibraryIds">The distinct Ids of the media libraries that contain those tracks.</param>
[DebuggerDisplay("TrackCount: {TrackCount}; Libraries: {LibraryIds.Count}")]
public sealed record TrackAccessSummaryDto(
int TrackCount,
IReadOnlyList<Guid> LibraryIds
);
@@ -0,0 +1,21 @@
#region ========================================================================= USING =====================================================================================
using System;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Lightweight read model of a track, containing only the fields needed to display the track in a list.
/// </summary>
/// <param name="Id">The Id of the track.</param>
/// <param name="Title">The title of the track.</param>
/// <param name="TrackNumber">The number of the track on its disc.</param>
/// <param name="DiscNumber">The number of the disc the track belongs to, if applicable.</param>
/// <param name="DurationInSeconds">The duration of the track in seconds.</param>
public sealed record TrackLiteRow(
Guid Id,
string Title,
int TrackNumber,
int? DiscNumber,
int DurationInSeconds
);
@@ -0,0 +1,36 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Data transfer object for the stored probe result of a track, containing only the fields a playback manifest is built from.
/// </summary>
/// <param name="Path">The file system path of the stored audio file of the track, used to bind a normalized delivery to the file version it was declared for.</param>
/// <param name="Container">The container of the audio file of the track, for example MP3, FLAC, OGG, AAC, MP4 or WAV, if applicable.</param>
/// <param name="AudioCodec">The audio codec used by the audio file of the track, if applicable.</param>
/// <param name="DurationInSeconds">The duration of the audio of the track in seconds.</param>
/// <param name="SampleRate">The sample rate of the audio of the track in Hz.</param>
/// <param name="Channels">The number of audio channels of the track.</param>
/// <param name="BitDepth">The bit depth of the audio of the track, if applicable.</param>
/// <param name="Bitrate">The bitrate of the audio of the track, in kbps, if applicable.</param>
/// <param name="ReplayGainTrackGain">The ReplayGain track gain of the track, in decibels, if applicable.</param>
/// <param name="ReplayGainTrackPeak">The ReplayGain track peak of the track, if applicable.</param>
/// <param name="ReplayGainAlbumGain">The ReplayGain album gain of the track, in decibels, if applicable.</param>
/// <param name="ReplayGainAlbumPeak">The ReplayGain album peak of the track, if applicable.</param>
[DebuggerDisplay("Container: {Container} Codec: {AudioCodec}")]
public sealed record TrackPlaybackManifestDto(
string Path,
string? Container,
string? AudioCodec,
int DurationInSeconds,
int SampleRate,
int Channels,
int? BitDepth,
int? Bitrate,
decimal? ReplayGainTrackGain,
decimal? ReplayGainTrackPeak,
decimal? ReplayGainAlbumGain,
decimal? ReplayGainAlbumPeak
);
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using System;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Data transfer object for a track, containing the data needed to stream, or to describe the streaming of, its audio file.
/// </summary>
/// <param name="Path">The file system path of the track.</param>
/// <param name="LibraryId">The Id of the media library the track belongs to.</param>
/// <param name="AlbumId">The Id of the album the track belongs to.</param>
/// <param name="ArtistId">The Id of the artist that owns the album the track belongs to.</param>
/// <param name="Container">The container of the audio file of the track, for example MP3, FLAC, OGG, AAC, MP4 or WAV, if applicable.</param>
/// <param name="AudioCodec">The audio codec used by the audio file of the track, if applicable.</param>
/// <param name="DurationInSeconds">The duration of the audio of the track in seconds.</param>
/// <param name="SampleRate">The sample rate of the audio of the track in Hz.</param>
/// <param name="Channels">The number of audio channels of the track.</param>
/// <param name="BitDepth">The bit depth of the audio of the track, if applicable.</param>
/// <param name="Bitrate">The bitrate of the audio of the track, in kbps, if applicable.</param>
public sealed record TrackStreamDto(
string Path,
Guid LibraryId,
Guid AlbumId,
Guid ArtistId,
string? Container,
string? AudioCodec,
int DurationInSeconds,
int SampleRate,
int Channels,
int? BitDepth,
int? Bitrate
);
@@ -0,0 +1,13 @@
namespace Lumina.Application.Common.DTO.MediaLibrary.Management;
/// <summary>
/// Data transfer object for one part of the path template of a media library, carried by the commands that create or update a media library.
/// </summary>
/// <param name="Kind">The kind of the path part.</param>
/// <param name="Representation">The literal text or the value mask of the path part.</param>
/// <param name="IsOptional">Whether the path part can be absent from the path.</param>
public record LibraryPathTemplatePartDto(
string? Kind,
string? Representation,
bool IsOptional
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.Management;
/// <summary>
/// Data transfer object for the choice made for one metadata provider, artwork provider or book reader of a media library, carried by the commands that create or update a media library.
/// </summary>
/// <param name="PluginId">The Id of the plugin providing the metadata provider, artwork provider or book reader.</param>
/// <param name="IsEnabled">Whether the provider or reader is enabled for the media library. When absent, the stored state is kept, and a provider or reader without a stored state starts disabled.</param>
[DebuggerDisplay("PluginId: {PluginId}; IsEnabled: {IsEnabled}")]
public record LibraryProviderSelectionDto(
Guid PluginId,
bool? IsEnabled
);
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using System;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Lightweight read model of a book, containing only the fields needed to display the book in a card-based grid or a list.
/// </summary>
/// <param name="Id">The Id of the book.</param>
/// <param name="Title">The title of the book.</param>
/// <param name="ReleaseYear">The release year of the book (re-release year, if available, or original release year), if known.</param>
/// <param name="CoverPath">The path of the image representing the cover of the book, if available.</param>
public sealed record BookLiteRow(
Guid Id,
string Title,
int? ReleaseYear,
string? CoverPath
);
@@ -0,0 +1,37 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
#endregion
namespace Lumina.Application.Common.DTO.Pagination;
/// <summary>
/// Represents a paginated result containing a subset of data and pagination metadata for the current page.
/// </summary>
/// <typeparam name="TData">The type of the data items contained in the paginated result.</typeparam>
public sealed record PaginatedResultDto<TData>
{
/// <summary>
/// Gets the collection of data items associated with this instance.
/// </summary>
public required IReadOnlyList<TData> Data { get; init; }
/// <summary>
/// Gets the current page number in a paginated collection.
/// </summary>
public required int CurrentPage { get; init; }
/// <summary>
/// Gets or sets the number of items to include per page in paginated results.
/// </summary>
public required int PerPage { get; init; }
/// <summary>
/// Gets the total number of elements available in the paginated result set.
/// </summary>
public required int Count { get; init; }
/// <summary>
/// Gets the total number of pages based on elements available in the result set and per page.
/// </summary>
public required int NumberOfPages { get; init; }
}
@@ -0,0 +1,38 @@
#region ========================================================================= USING =====================================================================================
using System;
#endregion
namespace Lumina.Application.Common.DTO.Pagination;
/// <summary>
/// Data transfer object for pagination metadata.
/// </summary>
public sealed record PaginationDataDto
{
private int perPage = 200;
private int currentPage = 1;
/// <summary>
/// Gets the current page number in a paginated collection.
/// </summary>
public int CurrentPage
{
get { return currentPage; }
set
{
currentPage = Math.Max(value, 1);
}
}
/// <summary>
/// Gets or sets the number of items to include per page in paginated results.
/// </summary>
public int PerPage
{
get { return perPage; }
set
{
perPage = Math.Max(value, 1);
}
}
}
@@ -0,0 +1,16 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.Playlists;
/// <summary>
/// Data transfer object for the result of appending entries to a playlist in one bulk operation.
/// </summary>
/// <param name="FirstPosition">The sparse order key of the first appended entry.</param>
/// <param name="AddedCount">The number of entries appended.</param>
[DebuggerDisplay("FirstPosition: {FirstPosition}; AddedCount: {AddedCount}")]
public sealed record PlaylistBulkAddResultDto(
long FirstPosition,
int AddedCount
);
@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Playlists;
using Lumina.Application.Common.DTO.Pagination;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.Playlists;
/// <summary>
/// Data transfer object for a stored playlist together with a page of its entries and their display data.
/// </summary>
/// <param name="Playlist">The stored playlist.</param>
/// <param name="Entries">The requested page of entries.</param>
[DebuggerDisplay("PlaylistId: {Playlist.Id}; Name: {Playlist.Name}; Entries: {Entries.Count}")]
public sealed record PlaylistDetailsDto(
PlaylistEntity Playlist,
PaginatedResultDto<PlaylistEntryDto> Entries
);
@@ -0,0 +1,31 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.Playlists;
/// <summary>
/// Data transfer object for the display data of the media item referenced by a playlist entry, together with its collection and creator.
/// </summary>
/// <param name="TrackId">The Id of the track.</param>
/// <param name="TrackTitle">The title of the track.</param>
/// <param name="DurationInSeconds">The duration of the track in seconds.</param>
/// <param name="LibraryId">The Id of the media library that contains the track.</param>
/// <param name="AlbumId">The Id of the album that contains the track.</param>
/// <param name="AlbumTitle">The title of the album that contains the track.</param>
/// <param name="ArtistId">The Id of the artist that produced the track.</param>
/// <param name="ArtistName">The name of the artist that produced the track.</param>
/// <param name="CoverPath">The path of the cover art of the album, if available.</param>
[DebuggerDisplay("TrackId: {TrackId}; TrackTitle: {TrackTitle}")]
public sealed record PlaylistEntryDisplayDto(
Guid TrackId,
string TrackTitle,
int DurationInSeconds,
Guid LibraryId,
Guid AlbumId,
string AlbumTitle,
Guid ArtistId,
string ArtistName,
string? CoverPath
);
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Playlists;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.Playlists;
/// <summary>
/// Data transfer object for a stored playlist entry together with the display data of the media item it references and its dense display position.
/// </summary>
/// <param name="Entry">The stored entry.</param>
/// <param name="Display">The display data of the referenced media item, or <see langword="null"/> when it no longer exists.</param>
/// <param name="DisplayPosition">The dense zero based position shown to the client.</param>
[DebuggerDisplay("EntryId: {Entry.Id}; MediaItemId: {Entry.MediaItemId}; Position: {DisplayPosition}")]
public sealed record PlaylistEntryDto(
PlaylistEntryEntity Entry,
PlaylistEntryDisplayDto? Display,
int DisplayPosition
);
@@ -0,0 +1,28 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.Playlists;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DTO.Playlists;
/// <summary>
/// Data transfer object for a playlist in a list, without its entries.
/// </summary>
/// <param name="Id">The Id of the playlist.</param>
/// <param name="Name">The name of the playlist.</param>
/// <param name="Description">The description of the playlist, if applicable.</param>
/// <param name="Type">The kind of media the playlist holds.</param>
/// <param name="EntryCount">The number of entries of the playlist.</param>
/// <param name="CreatedOnUtc">The date and time when the playlist was created.</param>
/// <param name="UpdatedOnUtc">The date and time when the playlist was last updated, if applicable.</param>
[DebuggerDisplay("Id: {Id}; Name: {Name}; EntryCount: {EntryCount}")]
public sealed record PlaylistSummaryDto(
Guid Id,
string Name,
string? Description,
PlaylistType Type,
int EntryCount,
DateTime CreatedOnUtc,
DateTime? UpdatedOnUtc
);
@@ -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; }
}
Loaded 100 of 6450 files, more files were not shown because too many files have changed in this diff. Show more