Adds the library statistics, history, resume, and deletion API endpoints

This commit is contained in:
BinaryAlley committed 2026-10-25 10:22:20 +02:00
1 parent c27621818c
commit dfd979ec1e
43 files changed
+3122

No files matched your search

@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaConsumption;
/// <summary>
/// Represents a request to delete the resume points of a user.
/// </summary>
/// <param name="LibraryId">The Id of the media library to restrict the deletion to. Optional.</param>
[DebuggerDisplay("LibraryId: {LibraryId}")]
public sealed record ClearResumePointsRequest(
string? LibraryId
);
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaConsumption;
/// <summary>
/// Represents a request for getting the consumption statistics of every user.
/// </summary>
/// <param name="LibraryId">The Id of the media library to restrict the statistics to. Optional.</param>
/// <param name="MediaKind">The kind of media to restrict the statistics to. Optional.</param>
/// <param name="FromUtc">The inclusive start of the date range. Optional.</param>
/// <param name="ToUtc">The inclusive end of the date range. Optional.</param>
[DebuggerDisplay("MediaKind: {MediaKind}; FromUtc: {FromUtc}; ToUtc: {ToUtc}")]
public sealed record GetAllUsersConsumptionStatisticsRequest(
string? LibraryId,
MediaKind? MediaKind,
DateTime? FromUtc,
DateTime? ToUtc
);
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaConsumption;
/// <summary>
/// Represents a request for getting the consumption statistics of a user.
/// </summary>
/// <param name="LibraryId">The Id of the media library to restrict the statistics to. Optional.</param>
/// <param name="MediaKind">The kind of media to restrict the statistics to. Optional.</param>
/// <param name="FromUtc">The inclusive start of the date range. Optional.</param>
/// <param name="ToUtc">The inclusive end of the date range. Optional.</param>
[DebuggerDisplay("MediaKind: {MediaKind}; FromUtc: {FromUtc}; ToUtc: {ToUtc}")]
public sealed record GetConsumptionStatisticsRequest(
string? LibraryId,
MediaKind? MediaKind,
DateTime? FromUtc,
DateTime? ToUtc
);
@@ -0,0 +1,21 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaConsumption;
/// <summary>
/// Represents a request for getting a window of the most consumed media items of a user.
/// </summary>
/// <param name="LibraryId">The Id of the media library to restrict the history to. Optional.</param>
/// <param name="MediaKind">The kind of media to restrict the history to. Optional.</param>
/// <param name="CurrentPage">The one based page of media items to return. Optional.</param>
/// <param name="PerPage">The number of media items per page. Optional.</param>
[DebuggerDisplay("MediaKind: {MediaKind}; CurrentPage: {CurrentPage}; PerPage: {PerPage}")]
public sealed record GetMostConsumedRequest(
string? LibraryId,
MediaKind? MediaKind,
int? CurrentPage,
int? PerPage
);
@@ -0,0 +1,21 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaConsumption;
/// <summary>
/// Represents a request for getting a window of the recently consumed media items of a user.
/// </summary>
/// <param name="LibraryId">The Id of the media library to restrict the history to. Optional.</param>
/// <param name="MediaKind">The kind of media to restrict the history to. Optional.</param>
/// <param name="CurrentPage">The one based page of media items to return. Optional.</param>
/// <param name="PerPage">The number of media items per page. Optional.</param>
[DebuggerDisplay("MediaKind: {MediaKind}; CurrentPage: {CurrentPage}; PerPage: {PerPage}")]
public sealed record GetRecentlyConsumedRequest(
string? LibraryId,
MediaKind? MediaKind,
int? CurrentPage,
int? PerPage
);
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaConsumption;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaConsumption;
/// <summary>
/// Represents a request for getting the consumption statistics of the tags and genres of a user.
/// </summary>
/// <param name="LibraryId">The Id of the media library to restrict the statistics to. Optional.</param>
/// <param name="MediaKind">The kind of media to restrict the statistics to. Optional.</param>
/// <param name="TagKind">Whether to return genres or tags. Optional.</param>
/// <param name="FromUtc">The inclusive start of the date range. Optional.</param>
/// <param name="ToUtc">The inclusive end of the date range. Optional.</param>
[DebuggerDisplay("MediaKind: {MediaKind}; TagKind: {TagKind}; FromUtc: {FromUtc}; ToUtc: {ToUtc}")]
public sealed record GetTagConsumptionRequest(
string? LibraryId,
MediaKind? MediaKind,
TagKind? TagKind,
DateTime? FromUtc,
DateTime? ToUtc
);