mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 04:11:10 +00:00
Renames project paths from Lumina to Nemera
This commit is contained in:
1 parent
ce6fddb4c9
commit
0f659a4877
6450 files changed
No files matched your search
@@ -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 = "*";
|
||||
}
|
||||
+17
@@ -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
|
||||
);
|
||||
+25
@@ -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
|
||||
);
|
||||
+25
@@ -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
|
||||
);
|
||||
+17
@@ -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
|
||||
);
|
||||
+34
@@ -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
|
||||
);
|
||||
+52
@@ -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
|
||||
);
|
||||
+29
@@ -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
|
||||
);
|
||||
+20
@@ -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
|
||||
);
|
||||
+16
@@ -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
|
||||
);
|
||||
+23
@@ -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
|
||||
);
|
||||
+25
@@ -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
|
||||
);
|
||||
+16
@@ -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
|
||||
);
|
||||
+25
@@ -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
|
||||
);
|
||||
+18
@@ -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
|
||||
);
|
||||
+21
@@ -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
|
||||
);
|
||||
+36
@@ -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
|
||||
);
|
||||
+33
@@ -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
|
||||
);
|
||||
+13
@@ -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
|
||||
);
|
||||
+17
@@ -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
|
||||
);
|
||||
+19
@@ -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
|
||||
);
|
||||
Reference in new issue
Block a user