mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 19:21:10 +00:00
Adds favorites and aligns playlist and favorite pagination
This commit is contained in:
1 parent
2e9f7d8496
commit
525ac1348d
193 files changed
+10944
-643
No files matched your search
@@ -0,0 +1,39 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Favorites;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Favorites;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response for a favorite of the current user together with the display details of the media item it references.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The display fields are generic across media kinds. For a music artist the title is the artist name and there is no collection or
|
||||
/// creator. For a music album the creator is the artist and there is no collection. For a music track the collection is the album and the
|
||||
/// creator is the artist. For a book there is no collection yet, because the series of a book is not catalogued, and the creator is its first author.
|
||||
/// </remarks>
|
||||
/// <param name="MediaKind">The kind of the favorited media item.</param>
|
||||
/// <param name="MediaItemId">The Id of the favorited media item.</param>
|
||||
/// <param name="IsAvailable">Whether the media item still exists and can be accessed by the user. When <see langword="false"/>, every display field is empty.</param>
|
||||
/// <param name="LibraryId">The Id of the media library that contains the media item, or an empty Guid when the item is not available.</param>
|
||||
/// <param name="Title">The title of the media item, or an empty string when the item is not available.</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("MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")]
|
||||
public sealed record FavoriteItemResponse(
|
||||
FavoriteMediaKind MediaKind,
|
||||
Guid MediaItemId,
|
||||
bool IsAvailable,
|
||||
Guid LibraryId,
|
||||
string Title,
|
||||
Guid CollectionId,
|
||||
string CollectionTitle,
|
||||
Guid CreatorId,
|
||||
string CreatorName,
|
||||
string? CoverPath
|
||||
);
|
||||
@@ -0,0 +1,22 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Favorites;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Favorites;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response for a favorite of the current user.
|
||||
/// </summary>
|
||||
/// <param name="Id">The Id of the favorite.</param>
|
||||
/// <param name="MediaKind">The kind of the favorited media item.</param>
|
||||
/// <param name="MediaItemId">The Id of the favorited media item.</param>
|
||||
/// <param name="FavoritedOnUtc">The date and time when the media item was favorited.</param>
|
||||
[DebuggerDisplay("Id: {Id}; MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")]
|
||||
public sealed record FavoriteResponse(
|
||||
Guid Id,
|
||||
FavoriteMediaKind MediaKind,
|
||||
Guid MediaItemId,
|
||||
DateTime FavoritedOnUtc
|
||||
);
|
||||
@@ -0,0 +1,16 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Favorites;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response that tells which of the checked media items are favorites of the current user.
|
||||
/// </summary>
|
||||
/// <param name="FavoritedMediaItemIds">The Ids, among the checked ones, of the media items that are favorites of the current user.</param>
|
||||
[DebuggerDisplay("Favorited: {FavoritedMediaItemIds.Count}")]
|
||||
public sealed record FavoriteStatusResponse(
|
||||
IReadOnlyList<Guid> FavoritedMediaItemIds
|
||||
);
|
||||
@@ -1,31 +1,29 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Contracts.Responses.Common;
|
||||
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.
|
||||
/// Represents a response for a playlist together with a page of 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="Entries">The ordered entries of the requested page 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}; Window: {Entries.Count}")]
|
||||
[DebuggerDisplay("Id: {Id}; Name: {Name}; Entries: {Entries.Count}")]
|
||||
public sealed record PlaylistResponse(
|
||||
Guid Id,
|
||||
string Name,
|
||||
string? Description,
|
||||
PlaylistType Type,
|
||||
IReadOnlyList<PlaylistEntryResponse> Entries,
|
||||
int EntryCount,
|
||||
PaginatedResponse<PlaylistEntryResponse> Entries,
|
||||
DateTime CreatedOnUtc,
|
||||
DateTime? UpdatedOnUtc
|
||||
);
|
||||
Reference in new issue
Block a user