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

@@ -1,22 +0,0 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary.PlayHistory;
/// <summary>
/// Data transfer object for the listening statistics of the current user.
/// </summary>
/// <param name="TotalListeningDurationInSeconds">The total duration the user listened to, over every recorded play, in seconds.</param>
/// <param name="TotalPlayCount">The number of recorded plays that count as plays. An in-progress play counts once it reaches the threshold, so this total can exceed the completed and stopped plays together.</param>
/// <param name="CompletedPlayCount">The number of recorded plays that completed.</param>
/// <param name="StoppedPlayCount">The number of recorded plays that stopped before the track completed and count as plays.</param>
/// <param name="CompletionRate">The fraction of the plays that count as plays that completed, between 0 and 1, or 0 when there is no counted play.</param>
[DebuggerDisplay("TotalPlayCount: {TotalPlayCount}; CompletedPlayCount: {CompletedPlayCount}")]
public sealed record MusicPlayStatisticsDto(
double TotalListeningDurationInSeconds,
int TotalPlayCount,
int CompletedPlayCount,
int StoppedPlayCount,
double CompletionRate
);
@@ -1,37 +0,0 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary.PlayHistory;
/// <summary>
/// Data transfer object for a track of the listening statistics of the current user, together with its aggregated play counts.
/// </summary>
/// <param name="TrackId">The Id of the track.</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="ArtistId">The Id of the artist that produced the track.</param>
/// <param name="Title">The title of the track, if it still exists and the user can access its library.</param>
/// <param name="AlbumTitle">The title of the album that contains the track, if it still exists and the user can access its library.</param>
/// <param name="ArtistName">The name of the artist that produced the track, if it still exists and the user can access its library.</param>
/// <param name="CoverPath">The path of the cover art of the album, if available.</param>
/// <param name="LastPlayedOnUtc">The date and time of the last recorded activity of the track's most recent play.</param>
/// <param name="PlayCount">The number of plays of the track that count as plays.</param>
/// <param name="CompletedPlayCount">The number of plays of the track that completed.</param>
/// <param name="ListenedDurationInSeconds">The duration the user listened to the track, over all of its counted plays, in seconds.</param>
[DebuggerDisplay("TrackId: {TrackId}; PlayCount: {PlayCount}")]
public sealed record PlayedTrackDto(
Guid TrackId,
Guid LibraryId,
Guid AlbumId,
Guid ArtistId,
string? Title,
string? AlbumTitle,
string? ArtistName,
string? CoverPath,
DateTime LastPlayedOnUtc,
int PlayCount,
int CompletedPlayCount,
double ListenedDurationInSeconds
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.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<ConsumptionSummaryDto> Users
);
@@ -0,0 +1,38 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.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="ConsumedDurationInSeconds">The active duration consumed in the media item, over all of its sessions, in seconds.</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,
double ConsumedDurationInSeconds
);
@@ -0,0 +1,28 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.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="TotalConsumedDurationInSeconds">The total duration consumed over every recorded session, in seconds.</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 ConsumptionSummaryDto(
Guid UserId,
double TotalConsumedDurationInSeconds,
int CountedSessionCount,
int CompletedSessionCount,
int StoppedSessionCount,
double CompletionRate,
IReadOnlyList<MediaKindConsumptionSummaryDto> MediaKindSummaries
);
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for the combined consumption statistics of every user.
/// </summary>
/// <param name="TotalConsumedDurationInSeconds">The total duration consumed over every recorded session of every user, in seconds.</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(
double TotalConsumedDurationInSeconds,
int CountedSessionCount,
int CompletedSessionCount,
int StoppedSessionCount,
double CompletionRate,
IReadOnlyList<MediaKindConsumptionSummaryDto> MediaKindSummaries
);
@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.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="ConsumedDurationInSeconds">The active duration consumed in the media items that carry the genre, in seconds.</param>
[DebuggerDisplay("Name: {Name}; ConsumedItemCount: {ConsumedItemCount}")]
public sealed record GenreConsumptionDto(
string Name,
int ConsumedItemCount,
double ConsumedDurationInSeconds
);
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for the consumption statistics of one kind of media.
/// </summary>
/// <param name="MediaKind">The kind of media the statistics belong to.</param>
/// <param name="TotalConsumedDurationInSeconds">The total duration consumed over every recorded session of the media kind, in seconds.</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.</param>
[DebuggerDisplay("MediaKind: {MediaKind}; CountedSessionCount: {CountedSessionCount}")]
public sealed record MediaKindConsumptionSummaryDto(
MediaKind MediaKind,
double TotalConsumedDurationInSeconds,
int CountedSessionCount,
int CompletedSessionCount,
int StoppedSessionCount,
double CompletionRate
);
@@ -0,0 +1,43 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.MediaConsumption;
/// <summary>
/// Data transfer object for the data and the proxy routes of the statistics page.
/// </summary>
/// <param name="Title">The localized title of the page.</param>
/// <param name="IsAdmin">Whether the current user is an administrator and can select another user or all users.</param>
/// <param name="CurrentUserId">The Id of the current user, or <see langword="null"/> when it cannot be determined.</param>
/// <param name="Culture">The culture of the page.</param>
/// <param name="GetStatisticsUrl">The route that returns the statistics of the selected user.</param>
/// <param name="GetAllUsersStatisticsUrl">The route that returns the statistics of every user.</param>
/// <param name="GetRecentlyConsumedUrl">The route that returns the recently consumed media items of the selected user.</param>
/// <param name="GetMostConsumedUrl">The route that returns the most consumed media items of the selected user.</param>
/// <param name="GetTagConsumptionUrl">The route that returns the tag consumption of the selected user.</param>
/// <param name="GetGenreConsumptionUrl">The route that returns the genre consumption of the selected user.</param>
/// <param name="GetLibrariesUrl">The route that returns the libraries available for the library filter.</param>
/// <param name="GetUsersUrl">The route that returns the users available for the administrator user selector, or an empty string for a regular user.</param>
/// <param name="DeleteConsumptionItemHistoryUrl">The route that deletes every consumption record of a media item.</param>
/// <param name="ClearConsumptionHistoryUrl">The route that deletes the consumption history of the selected user.</param>
/// <param name="ClearResumePointsUrl">The route that deletes the resume points of the selected user.</param>
[DebuggerDisplay("IsAdmin: {IsAdmin}; CurrentUserId: {CurrentUserId}")]
public sealed record StatisticsPageDto(
string Title,
bool IsAdmin,
Guid? CurrentUserId,
string Culture,
string GetStatisticsUrl,
string GetAllUsersStatisticsUrl,
string GetRecentlyConsumedUrl,
string GetMostConsumedUrl,
string GetTagConsumptionUrl,
string GetGenreConsumptionUrl,
string GetLibrariesUrl,
string GetUsersUrl,
string DeleteConsumptionItemHistoryUrl,
string ClearConsumptionHistoryUrl,
string ClearResumePointsUrl
);
@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.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="ConsumedDurationInSeconds">The active duration consumed in the media items that carry the tag, in seconds.</param>
[DebuggerDisplay("Name: {Name}; ConsumedItemCount: {ConsumedItemCount}")]
public sealed record TagConsumptionDto(
string Name,
int ConsumedItemCount,
double ConsumedDurationInSeconds
);
@@ -0,0 +1,52 @@
namespace Lumina.Presentation.Web.Common.Enums.MediaConsumption;
/// <summary>
/// Enumeration for the kinds of media items of the consumption history and statistics.
/// </summary>
public enum MediaKind
{
/// <summary>
/// No media kind. Used as the default value; it is not a valid kind for a media item.
/// </summary>
None = 0,
/// <summary>
/// A track of a music library.
/// </summary>
MusicTrack,
/// <summary>
/// An episode of a podcast.
/// </summary>
PodcastEpisode,
/// <summary>
/// An audiobook.
/// </summary>
Audiobook,
/// <summary>
/// A movie.
/// </summary>
Movie,
/// <summary>
/// An episode of a TV show.
/// </summary>
TvEpisode,
/// <summary>
/// A book of a written content library.
/// </summary>
Book,
/// <summary>
/// A photo.
/// </summary>
Photo,
/// <summary>
/// A video file.
/// </summary>
Video
}
@@ -1,16 +0,0 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.PlayHistory;
/// <summary>
/// Represents a request for getting a page of the most played tracks of the current user.
/// </summary>
/// <param name="CurrentPage">The one based page of tracks to return. Optional. Defaults to 1.</param>
/// <param name="PerPage">The number of tracks per page. Optional. Defaults to 10.</param>
[DebuggerDisplay("CurrentPage: {CurrentPage}; PerPage: {PerPage}")]
public record GetMostPlayedRequest(
int? CurrentPage,
int? PerPage
);
@@ -1,16 +0,0 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.PlayHistory;
/// <summary>
/// Represents a request for getting a page of the recently played tracks of the current user.
/// </summary>
/// <param name="CurrentPage">The one based page of tracks to return. Optional. Defaults to 1.</param>
/// <param name="PerPage">The number of tracks per page. Optional. Defaults to 10.</param>
[DebuggerDisplay("CurrentPage: {CurrentPage}; PerPage: {PerPage}")]
public record GetRecentlyPlayedRequest(
int? CurrentPage,
int? PerPage
);
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.Statistics;
/// <summary>
/// Represents a request to delete the consumption history of a user.
/// </summary>
/// <param name="UserId">The Id of the user whose history is deleted. Optional; when omitted, the current user is used.</param>
[DebuggerDisplay("UserId: {UserId}")]
public sealed record ClearConsumptionHistoryRequest(
string? UserId
);
@@ -0,0 +1,16 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.Statistics;
/// <summary>
/// Represents a request to delete the resume points of a user.
/// </summary>
/// <param name="UserId">The Id of the user whose resume points are deleted. Optional; when omitted, the current user is used.</param>
/// <param name="LibraryId">The Id of the media library to restrict the deletion to. Optional.</param>
[DebuggerDisplay("UserId: {UserId}; LibraryId: {LibraryId}")]
public sealed record ClearResumePointsRequest(
string? UserId,
string? LibraryId
);
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.Statistics;
/// <summary>
/// Represents a request to delete every consumption record of a media item.
/// </summary>
/// <param name="UserId">The Id of the user whose history is deleted. Optional; when omitted, the current user is used.</param>
/// <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("UserId: {UserId}; MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")]
public sealed record DeleteConsumptionItemHistoryRequest(
string? UserId,
MediaKind MediaKind,
Guid MediaItemId,
Guid LibraryId
);
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.Statistics;
/// <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,24 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.Statistics;
/// <summary>
/// Represents a request for getting the consumption statistics of a user.
/// </summary>
/// <param name="UserId">The Id of the user whose statistics are retrieved. Optional; when omitted, the current user is used.</param>
/// <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("UserId: {UserId}; MediaKind: {MediaKind}")]
public sealed record GetConsumptionStatisticsRequest(
string? UserId,
string? LibraryId,
MediaKind? MediaKind,
DateTime? FromUtc,
DateTime? ToUtc
);
@@ -0,0 +1,24 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.Statistics;
/// <summary>
/// Represents a request for getting the consumption statistics of the genres of a user.
/// </summary>
/// <param name="UserId">The Id of the user whose statistics are retrieved. Optional; when omitted, the current user is used.</param>
/// <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("UserId: {UserId}; MediaKind: {MediaKind}; FromUtc: {FromUtc}")]
public sealed record GetGenreConsumptionRequest(
string? UserId,
string? LibraryId,
MediaKind? MediaKind,
DateTime? FromUtc,
DateTime? ToUtc
);
@@ -0,0 +1,28 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.Statistics;
/// <summary>
/// Represents a request for getting a window of the most consumed media items of a user.
/// </summary>
/// <param name="UserId">The Id of the user whose history is retrieved. Optional; when omitted, the current user is used.</param>
/// <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="FromUtc">The inclusive start of the date range. Optional.</param>
/// <param name="ToUtc">The inclusive end of the date range. 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("UserId: {UserId}; MediaKind: {MediaKind}; CurrentPage: {CurrentPage}")]
public sealed record GetMostConsumedRequest(
string? UserId,
string? LibraryId,
MediaKind? MediaKind,
DateTime? FromUtc,
DateTime? ToUtc,
int? CurrentPage,
int? PerPage
);
@@ -0,0 +1,28 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.Statistics;
/// <summary>
/// Represents a request for getting a window of the recently consumed media items of a user.
/// </summary>
/// <param name="UserId">The Id of the user whose history is retrieved. Optional; when omitted, the current user is used.</param>
/// <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="FromUtc">The inclusive start of the date range. Optional.</param>
/// <param name="ToUtc">The inclusive end of the date range. 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("UserId: {UserId}; MediaKind: {MediaKind}; CurrentPage: {CurrentPage}")]
public sealed record GetRecentlyConsumedRequest(
string? UserId,
string? LibraryId,
MediaKind? MediaKind,
DateTime? FromUtc,
DateTime? ToUtc,
int? CurrentPage,
int? PerPage
);
@@ -0,0 +1,24 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.Statistics;
/// <summary>
/// Represents a request for getting the consumption statistics of the tags of a user.
/// </summary>
/// <param name="UserId">The Id of the user whose statistics are retrieved. Optional; when omitted, the current user is used.</param>
/// <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("UserId: {UserId}; MediaKind: {MediaKind}; FromUtc: {FromUtc}")]
public sealed record GetTagConsumptionRequest(
string? UserId,
string? LibraryId,
MediaKind? MediaKind,
DateTime? FromUtc,
DateTime? ToUtc
);
@@ -0,0 +1,31 @@
namespace Lumina.Presentation.Web.Common.Routes;
/// <summary>
/// Class for the collection of remote API routes called by this Web application.
/// </summary>
public static partial class ApiRoutes
{
/// <summary>
/// Routes for the consumption history, consumption statistics, and resume points of the remote API.
/// </summary>
public static class LibraryStatistics
{
public const string GET_RECENTLY_CONSUMED = "users/me/consumption-history/recently-consumed";
public const string GET_MOST_CONSUMED = "users/me/consumption-history/most-consumed";
public const string GET_CONSUMPTION_STATISTICS = "users/me/consumption-statistics";
public const string GET_TAG_CONSUMPTION = "users/me/consumption-statistics/tags";
public const string GET_GENRE_CONSUMPTION = "users/me/consumption-statistics/genres";
public const string GET_USER_RECENTLY_CONSUMED = "users/{userId}/consumption-history/recently-consumed";
public const string GET_USER_MOST_CONSUMED = "users/{userId}/consumption-history/most-consumed";
public const string GET_USER_CONSUMPTION_STATISTICS = "users/{userId}/consumption-statistics";
public const string GET_USER_TAG_CONSUMPTION = "users/{userId}/consumption-statistics/tags";
public const string GET_USER_GENRE_CONSUMPTION = "users/{userId}/consumption-statistics/genres";
public const string GET_ALL_USERS_CONSUMPTION_STATISTICS = "users/consumption-statistics";
public const string DELETE_CONSUMPTION_ITEM_HISTORY = "users/me/consumption-history/media-items/{mediaKind}/{mediaItemId}/{libraryId}";
public const string DELETE_USER_CONSUMPTION_ITEM_HISTORY = "users/{userId}/consumption-history/media-items/{mediaKind}/{mediaItemId}/{libraryId}";
public const string CLEAR_CONSUMPTION_HISTORY = "users/me/consumption-history";
public const string CLEAR_USER_CONSUMPTION_HISTORY = "users/{userId}/consumption-history";
public const string CLEAR_RESUME_POINTS = "users/me/media-resume-points";
public const string CLEAR_USER_RESUME_POINTS = "users/{userId}/media-resume-points";
}
}
@@ -1,17 +0,0 @@
namespace Lumina.Presentation.Web.Common.Routes;
/// <summary>
/// Class for the collection of remote API routes called by this Web application.
/// </summary>
public static partial class ApiRoutes
{
/// <summary>
/// Routes for the music play statistics endpoints of the remote API.
/// </summary>
public static class PlayStatistics
{
public const string GET_RECENTLY_PLAYED = "users/me/music-play-history/recently-played";
public const string GET_MOST_PLAYED = "users/me/music-play-history/most-played";
public const string GET_MUSIC_PLAY_STATISTICS = "users/me/music-play-history/statistics";
}
}
@@ -11,8 +11,16 @@ public static partial class WebRoutes
public static class LibraryStatistics
{
public const string INDEX = "{culture}/library/statistics";
public const string GET_RECENTLY_PLAYED = "{culture}/library/statistics/api-get-recently-played";
public const string GET_MOST_PLAYED = "{culture}/library/statistics/api-get-most-played";
public const string GET_MUSIC_PLAY_STATISTICS = "{culture}/library/statistics/api-get-music-play-statistics";
public const string GET_STATISTICS = "{culture}/library/statistics/api-get-statistics";
public const string GET_ALL_USERS_STATISTICS = "{culture}/library/statistics/api-get-all-users-statistics";
public const string GET_RECENTLY_CONSUMED = "{culture}/library/statistics/api-get-recently-consumed";
public const string GET_MOST_CONSUMED = "{culture}/library/statistics/api-get-most-consumed";
public const string GET_TAG_CONSUMPTION = "{culture}/library/statistics/api-get-tag-consumption";
public const string GET_GENRE_CONSUMPTION = "{culture}/library/statistics/api-get-genre-consumption";
public const string GET_LIBRARIES = "{culture}/library/statistics/api-get-libraries";
public const string GET_USERS = "{culture}/library/statistics/api-get-users";
public const string DELETE_CONSUMPTION_ITEM_HISTORY = "{culture}/library/statistics/api-delete-consumption-item-history";
public const string CLEAR_CONSUMPTION_HISTORY = "{culture}/library/statistics/api-clear-consumption-history";
public const string CLEAR_RESUME_POINTS = "{culture}/library/statistics/api-clear-resume-points";
}
}