Adds playlist management and playback

This commit is contained in:
BinaryAlley committed 2026-10-21 16:30:58 +03:00
1 parent 009a0c8156
commit 9889c86c76
296 files changed
+18830 -367

No files matched your search

@@ -0,0 +1,24 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.Playlists;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.Playlists;
/// <summary>
/// Represents a response for the editable scalars of a playlist after a details update.
/// </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="UpdatedOnUtc">The date and time when the playlist was last updated, if applicable.</param>
[DebuggerDisplay("Id: {Id}; Name: {Name}")]
public sealed record PlaylistDetailsResponse(
Guid Id,
string Name,
string? Description,
PlaylistType Type,
DateTime? UpdatedOnUtc
);
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.Playlists;
/// <summary>
/// Represents a response for the result of appending several tracks to a playlist, without returning the whole playlist.
/// </summary>
/// <param name="PlaylistId">The Id of the playlist the entries were added to.</param>
/// <param name="AddedCount">The number of entries that were appended, including repeated tracks.</param>
/// <param name="UpdatedOnUtc">The date and time when the playlist was last updated, if applicable.</param>
[DebuggerDisplay("PlaylistId: {PlaylistId}; AddedCount: {AddedCount}")]
public sealed record PlaylistEntriesAddedResponse(
Guid PlaylistId,
int AddedCount,
DateTime? UpdatedOnUtc
);
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.Playlists;
/// <summary>
/// Represents a response for the entry that was appended to a playlist, together with its playlist and the new activity time of the playlist.
/// </summary>
/// <param name="PlaylistId">The Id of the playlist the entry was added to.</param>
/// <param name="Entry">The added entry, with the display details of the media item it references.</param>
/// <param name="UpdatedOnUtc">The date and time when the playlist was last updated, if applicable.</param>
[DebuggerDisplay("PlaylistId: {PlaylistId}; Entry: {Entry.Id}")]
public sealed record PlaylistEntryAddedResponse(
Guid PlaylistId,
PlaylistEntryResponse Entry,
DateTime? UpdatedOnUtc
);
@@ -0,0 +1,21 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.Playlists;
/// <summary>
/// Represents a response for the result of moving one entry of a playlist to a new position.
/// </summary>
/// <param name="PlaylistId">The Id of the playlist whose entry was moved.</param>
/// <param name="EntryId">The Id of the moved entry.</param>
/// <param name="Position">The new zero based position of the entry.</param>
/// <param name="UpdatedOnUtc">The date and time when the playlist was last updated, if applicable.</param>
[DebuggerDisplay("PlaylistId: {PlaylistId}; EntryId: {EntryId}; Position: {Position}")]
public sealed record PlaylistEntryMovedResponse(
Guid PlaylistId,
Guid EntryId,
int Position,
DateTime? UpdatedOnUtc
);
@@ -0,0 +1,21 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.Playlists;
/// <summary>
/// Represents a response for the result of removing an entry from a playlist.
/// </summary>
/// <param name="PlaylistId">The Id of the playlist the entry was removed from.</param>
/// <param name="RemovedEntryId">The Id of the removed entry.</param>
/// <param name="RepositionedCount">Always zero, because sparse order keys need no remaining entries to be repositioned.</param>
/// <param name="UpdatedOnUtc">The date and time when the playlist was last updated, if applicable.</param>
[DebuggerDisplay("PlaylistId: {PlaylistId}; RemovedEntryId: {RemovedEntryId}; RepositionedCount: {RepositionedCount}")]
public sealed record PlaylistEntryRemovedResponse(
Guid PlaylistId,
Guid RemovedEntryId,
int RepositionedCount,
DateTime? UpdatedOnUtc
);
@@ -0,0 +1,38 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.Playlists;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.Playlists;
/// <summary>
/// Represents a response for an ordered entry of a playlist.
/// </summary>
/// <param name="Id">The Id of the entry.</param>
/// <param name="MediaItemId">The Id of the media item referenced by the entry.</param>
/// <param name="MediaItemType">The kind of media item referenced by the entry.</param>
/// <param name="Position">The zero based position of the entry in the playlist.</param>
/// <param name="LibraryId">The Id of the media library that contains the media item, or an empty Guid when the item no longer exists.</param>
/// <param name="CollectionId">The Id of the collection that contains the media item, or an empty Guid when the item no longer exists.</param>
/// <param name="CreatorId">The Id of the creator of the media item, or an empty Guid when the item no longer exists.</param>
/// <param name="MediaItemTitle">The title of the media item, or an empty string when the item no longer exists.</param>
/// <param name="CollectionTitle">The title of the collection that contains the media item, or an empty string when the item no longer exists.</param>
/// <param name="CreatorName">The name of the creator of the media item, or an empty string when the item no longer exists.</param>
/// <param name="DurationInSeconds">The duration of the media item in seconds, or zero when the item no longer exists.</param>
/// <param name="CoverPath">The path of the cover art of the collection, if available.</param>
[DebuggerDisplay("MediaItemId: {MediaItemId}; MediaItemType: {MediaItemType}; Position: {Position}")]
public sealed record PlaylistEntryResponse(
Guid Id,
Guid MediaItemId,
PlaylistMediaItemType MediaItemType,
int Position,
Guid LibraryId,
Guid CollectionId,
Guid CreatorId,
string MediaItemTitle,
string CollectionTitle,
string CreatorName,
int DurationInSeconds,
string? CoverPath
);
@@ -0,0 +1,31 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.Playlists;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.Playlists;
/// <summary>
/// Represents a response for a playlist together with its ordered 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="Entries">The ordered entries of the requested window of the playlist.</param>
/// <param name="EntryCount">The number of entries the playlist holds, even when only a window of them is returned.</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}; Window: {Entries.Count}")]
public sealed record PlaylistResponse(
Guid Id,
string Name,
string? Description,
PlaylistType Type,
IReadOnlyList<PlaylistEntryResponse> Entries,
int EntryCount,
DateTime CreatedOnUtc,
DateTime? UpdatedOnUtc
);
@@ -0,0 +1,28 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.Playlists;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.Playlists;
/// <summary>
/// Represents a response 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 PlaylistSummaryResponse(
Guid Id,
string Name,
string? Description,
PlaylistType Type,
int EntryCount,
DateTime CreatedOnUtc,
DateTime? UpdatedOnUtc
);