Adds the media-neutral library statistics page and separates tags from genres

This commit is contained in:
BinaryAlley committed 2026-10-25 15:51:27 +02:00
1 parent a61fbf407c
commit 00d7eff777
118 files changed
+6132 -1154

No files matched your search

@@ -0,0 +1,20 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaConsumption;
/// <summary>
/// Represents a request to delete every consumption record of a media item.
/// </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>
[DebuggerDisplay("MediaKind: {MediaKind}; MediaItemId: {MediaItemId}; LibraryId: {LibraryId}")]
public sealed record DeleteConsumptionItemHistoryRequest(
MediaKind MediaKind,
Guid MediaItemId,
Guid 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 the 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="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 GetGenreConsumptionRequest(
string? LibraryId,
MediaKind? MediaKind,
DateTime? FromUtc,
DateTime? ToUtc
);
@@ -1,5 +1,6 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
@@ -12,10 +13,14 @@ namespace Lumina.Contracts.Requests.MediaConsumption;
/// <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>
/// <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}; CurrentPage: {CurrentPage}; PerPage: {PerPage}")]
public sealed record GetMostConsumedRequest(
string? LibraryId,
MediaKind? MediaKind,
int? CurrentPage,
int? PerPage
int? PerPage,
DateTime? FromUtc,
DateTime? ToUtc
);
@@ -1,5 +1,6 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
@@ -12,10 +13,14 @@ namespace Lumina.Contracts.Requests.MediaConsumption;
/// <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>
/// <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}; CurrentPage: {CurrentPage}; PerPage: {PerPage}")]
public sealed record GetRecentlyConsumedRequest(
string? LibraryId,
MediaKind? MediaKind,
int? CurrentPage,
int? PerPage
int? PerPage,
DateTime? FromUtc,
DateTime? ToUtc
);
@@ -1,5 +1,4 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaConsumption;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
@@ -8,18 +7,16 @@ using System.Diagnostics;
namespace Lumina.Contracts.Requests.MediaConsumption;
/// <summary>
/// Represents a request for getting the consumption statistics of the tags and genres of a user.
/// Represents a request for getting the consumption statistics of the tags 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}")]
[DebuggerDisplay("MediaKind: {MediaKind}; FromUtc: {FromUtc}; ToUtc: {ToUtc}")]
public sealed record GetTagConsumptionRequest(
string? LibraryId,
MediaKind? MediaKind,
TagKind? TagKind,
DateTime? FromUtc,
DateTime? ToUtc
);
@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.MediaConsumption;
/// <summary>
/// Represents 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="ConsumedDurationInSeconds">The active duration consumed in the media items that carry the genre, in seconds.</param>
[DebuggerDisplay("Name: {Name}; ConsumedItemCount: {ConsumedItemCount}")]
public sealed record GenreConsumptionResponse(
string Name,
int ConsumedItemCount,
double ConsumedDurationInSeconds
);
@@ -1,21 +1,18 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaConsumption;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.MediaConsumption;
/// <summary>
/// Represents the consumption statistics of a tag or genre, grouped across media kinds.
/// Represents the consumption statistics of a tag, grouped across media kinds.
/// </summary>
/// <param name="Name">The lowercase name of the tag or genre.</param>
/// <param name="TagKind">Whether the entry is a genre or a tag.</param>
/// <param name="ConsumedItemCount">The number of distinct media items that carry the term and were consumed.</param>
/// <param name="ConsumedDurationInSeconds">The active duration consumed in the media items that carry the term, in seconds.</param>
[DebuggerDisplay("TagKind: {TagKind}; Name: {Name}; ConsumedItemCount: {ConsumedItemCount}")]
/// <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="ConsumedDurationInSeconds">The active duration consumed in the media items that carry the tag, in seconds.</param>
[DebuggerDisplay("Name: {Name}; ConsumedItemCount: {ConsumedItemCount}")]
public sealed record TagConsumptionResponse(
string Name,
TagKind TagKind,
int ConsumedItemCount,
double ConsumedDurationInSeconds
);