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";
}
}
@@ -0,0 +1,61 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.ClearConsumptionHistory;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-clear-consumption-history</c> route.
/// </summary>
public class ClearConsumptionHistoryEndpoint : BaseEndpoint<ClearConsumptionHistoryRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="ClearConsumptionHistoryEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public ClearConsumptionHistoryEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.DELETE);
Routes(WebRoutes.LibraryStatistics.CLEAR_CONSUMPTION_HISTORY);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
EnableAntiforgery();
}
/// <summary>
/// Deletes every consumption record of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(ClearConsumptionHistoryRequest request, CancellationToken cancellationToken)
{
// The history belongs to the selected user, so no intermediary may store any response of this route, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
string path = string.IsNullOrWhiteSpace(request.UserId)
? ApiRoutes.LibraryStatistics.CLEAR_CONSUMPTION_HISTORY
: ApiRoutes.LibraryStatistics.CLEAR_USER_CONSUMPTION_HISTORY.Replace("{userId}", Uri.EscapeDataString(request.UserId), StringComparison.Ordinal);
await _apiHttpClient.DeleteAsync(path, cancellationToken).ConfigureAwait(false);
return JsonSuccess();
}
}
@@ -0,0 +1,32 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.ClearConsumptionHistory;
/// <summary>
/// Class used for providing a textual description for the <see cref="ClearConsumptionHistoryEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class ClearConsumptionHistoryEndpointSummary : Summary<ClearConsumptionHistoryEndpoint, ClearConsumptionHistoryRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="ClearConsumptionHistoryEndpointSummary"/> class.
/// </summary>
public ClearConsumptionHistoryEndpointSummary()
{
Summary = "Deletes every consumption record of the selected user.";
Description = "Proxies the request that deletes every recorded consumption session of the selected user to the API server. When userId is omitted, the history of the current user is deleted; an administrator can name another user. Clearing an already empty history succeeds without changing anything. The resume points are not deleted. A failure is returned as a JSON object with success set to false and a localized errorMessage.";
RequestParam(request => request.UserId, "The Id of the user whose history is deleted. Optional; when omitted, the current user is used.");
ResponseParam<SuccessResponse>(response => response.IsSuccess, "Whether the operation succeeded.");
Response(200, "The consumption history was cleared, or a JSON error with success set to false.",
example: new SuccessResponse(true)
);
}
}
@@ -0,0 +1,63 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.ClearResumePoints;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-clear-resume-points</c> route.
/// </summary>
public class ClearResumePointsEndpoint : BaseEndpoint<ClearResumePointsRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="ClearResumePointsEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public ClearResumePointsEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.DELETE);
Routes(WebRoutes.LibraryStatistics.CLEAR_RESUME_POINTS);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
EnableAntiforgery();
}
/// <summary>
/// Deletes the resume points of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user and the optional library filter.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(ClearResumePointsRequest request, CancellationToken cancellationToken)
{
// The resume points belong to the selected user, so no intermediary may store any response of this route, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
string path = string.IsNullOrWhiteSpace(request.UserId)
? ApiRoutes.LibraryStatistics.CLEAR_RESUME_POINTS
: ApiRoutes.LibraryStatistics.CLEAR_USER_RESUME_POINTS.Replace("{userId}", Uri.EscapeDataString(request.UserId), StringComparison.Ordinal);
if (!string.IsNullOrWhiteSpace(request.LibraryId))
path += $"?libraryId={Uri.EscapeDataString(request.LibraryId)}";
await _apiHttpClient.DeleteAsync(path, cancellationToken).ConfigureAwait(false);
return JsonSuccess();
}
}
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.ClearResumePoints;
/// <summary>
/// Class used for providing a textual description for the <see cref="ClearResumePointsEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class ClearResumePointsEndpointSummary : Summary<ClearResumePointsEndpoint, ClearResumePointsRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="ClearResumePointsEndpointSummary"/> class.
/// </summary>
public ClearResumePointsEndpointSummary()
{
Summary = "Deletes the resume points of the selected user.";
Description = "Proxies the request that deletes the resume points of the selected user, optionally limited to one library, to the API server. When userId is omitted, the resume points of the current user are deleted; an administrator can name another user. The consumption history is not deleted. A failure is returned as a JSON object with success set to false and a localized errorMessage.";
RequestParam(request => request.UserId, "The Id of the user whose resume points are deleted. Optional; when omitted, the current user is used.");
RequestParam(request => request.LibraryId, "The Id of the media library to restrict the deletion to. Optional.");
ResponseParam<SuccessResponse>(response => response.IsSuccess, "Whether the operation succeeded.");
Response(200, "The resume points were removed, or a JSON error with success set to false.",
example: new SuccessResponse(true)
);
}
}
@@ -0,0 +1,65 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.DeleteConsumptionItemHistory;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-delete-consumption-item-history</c> route.
/// </summary>
public class DeleteConsumptionItemHistoryEndpoint : BaseEndpoint<DeleteConsumptionItemHistoryRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="DeleteConsumptionItemHistoryEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public DeleteConsumptionItemHistoryEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.DELETE);
Routes(WebRoutes.LibraryStatistics.DELETE_CONSUMPTION_ITEM_HISTORY);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
EnableAntiforgery();
}
/// <summary>
/// Deletes every consumption record of a media item of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user, the media item, and its library.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(DeleteConsumptionItemHistoryRequest request, CancellationToken cancellationToken)
{
// The records belong to the selected user, so no intermediary may store any response of this route, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
string path = string.IsNullOrWhiteSpace(request.UserId)
? ApiRoutes.LibraryStatistics.DELETE_CONSUMPTION_ITEM_HISTORY
: ApiRoutes.LibraryStatistics.DELETE_USER_CONSUMPTION_ITEM_HISTORY.Replace("{userId}", Uri.EscapeDataString(request.UserId), StringComparison.Ordinal);
path = path
.Replace("{mediaKind}", request.MediaKind.ToString(), StringComparison.Ordinal)
.Replace("{mediaItemId}", request.MediaItemId.ToString(), StringComparison.Ordinal)
.Replace("{libraryId}", request.LibraryId.ToString(), StringComparison.Ordinal);
await _apiHttpClient.DeleteAsync(path, cancellationToken).ConfigureAwait(false);
return JsonSuccess();
}
}
@@ -0,0 +1,35 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.DeleteConsumptionItemHistory;
/// <summary>
/// Class used for providing a textual description for the <see cref="DeleteConsumptionItemHistoryEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class DeleteConsumptionItemHistoryEndpointSummary : Summary<DeleteConsumptionItemHistoryEndpoint, DeleteConsumptionItemHistoryRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="DeleteConsumptionItemHistoryEndpointSummary"/> class.
/// </summary>
public DeleteConsumptionItemHistoryEndpointSummary()
{
Summary = "Deletes every consumption record of a media item of the selected user.";
Description = "Proxies the request that deletes every recorded consumption session of one media item of the selected user, in the library named by the request, to the API server. The deletion covers every session of the item, independent of any date range. When userId is omitted, the history of the current user is deleted; an administrator can name another user. Deleting an item that has no recorded session succeeds without changing anything. The resume point of the media item is not deleted. A failure is returned as a JSON object with success set to false and a localized errorMessage.";
RequestParam(request => request.UserId, "The Id of the user whose history is deleted. Optional; when omitted, the current user is used.");
RequestParam(request => request.MediaKind, "The kind of the consumed media item.");
RequestParam(request => request.MediaItemId, "The Id of the consumed media item.");
RequestParam(request => request.LibraryId, "The Id of the media library that contains the media item.");
ResponseParam<SuccessResponse>(response => response.IsSuccess, "Whether the operation succeeded.");
Response(200, "The consumption records of the media item were deleted, or a JSON error with success set to false.",
example: new SuccessResponse(true)
);
}
}
@@ -0,0 +1,86 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Authorization;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetAllUsersConsumptionStatistics;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-get-all-users-statistics</c> route.
/// </summary>
public class GetAllUsersConsumptionStatisticsEndpoint : BaseEndpoint<GetAllUsersConsumptionStatisticsRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetAllUsersConsumptionStatisticsEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetAllUsersConsumptionStatisticsEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.LibraryStatistics.GET_ALL_USERS_STATISTICS);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
Policies(AuthorizationPolicies.REQUIRE_ADMIN_ROLE);
}
/// <summary>
/// Retrieves the combined consumption statistics of every user.
/// </summary>
/// <param name="request">The request containing the optional filters.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetAllUsersConsumptionStatisticsRequest request, CancellationToken cancellationToken)
{
// The statistics belong to every user of the server, so no intermediary may store them, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
AllUsersConsumptionStatisticsDto response = await _apiHttpClient.GetAsync<AllUsersConsumptionStatisticsDto>(BuildStatisticsEndpoint(request), cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
/// <summary>
/// Builds the API endpoint used to retrieve the combined consumption statistics of every user.
/// </summary>
/// <param name="request">The request containing the optional filters.</param>
/// <returns>The API endpoint to which the statistics request is sent.</returns>
private static string BuildStatisticsEndpoint(GetAllUsersConsumptionStatisticsRequest request)
{
// The query string is rebuilt from the typed request values instead of forwarding the raw one, so that crafted text can never alter the upstream URL.
StringBuilder endpoint = new(ApiRoutes.LibraryStatistics.GET_ALL_USERS_CONSUMPTION_STATISTICS);
List<string> parameters = [];
if (!string.IsNullOrWhiteSpace(request.LibraryId))
parameters.Add($"libraryId={Uri.EscapeDataString(request.LibraryId)}");
if (request.MediaKind is not null)
parameters.Add($"mediaKind={Uri.EscapeDataString(request.MediaKind.Value.ToString())}");
if (request.FromUtc is not null)
parameters.Add($"fromUtc={Uri.EscapeDataString(request.FromUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
if (request.ToUtc is not null)
parameters.Add($"toUtc={Uri.EscapeDataString(request.ToUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
if (parameters.Count > 0)
endpoint.Append('?').Append(string.Join('&', parameters));
return endpoint.ToString();
}
}
@@ -0,0 +1,113 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetAllUsersConsumptionStatistics;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetAllUsersConsumptionStatisticsEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetAllUsersConsumptionStatisticsEndpointSummary : Summary<GetAllUsersConsumptionStatisticsEndpoint, GetAllUsersConsumptionStatisticsRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetAllUsersConsumptionStatisticsEndpointSummary"/> class.
/// </summary>
public GetAllUsersConsumptionStatisticsEndpointSummary()
{
Summary = "Gets the consumption statistics of every user.";
Description = "Proxies the request that gets the combined consumption statistics of every user, together with the statistics of each user, to the API server. Only an administrator can call it. The date range is inclusive. A failure is returned as a JSON object with success set to false and a localized errorMessage.";
ExampleRequest = new GetAllUsersConsumptionStatisticsRequest(
LibraryId: null,
MediaKind: null,
FromUtc: new DateTime(2026, 10, 1, 0, 0, 0, DateTimeKind.Utc),
ToUtc: new DateTime(2026, 10, 31, 23, 59, 59, DateTimeKind.Utc)
);
RequestParam(request => request.LibraryId, "The Id of the media library to restrict the statistics to. Optional.");
RequestParam(request => request.MediaKind, "The kind of media to restrict the statistics to. Optional.");
RequestParam(request => request.FromUtc, "The inclusive start of the date range. Optional.");
RequestParam(request => request.ToUtc, "The inclusive end of the date range. Optional.");
ResponseParam<SuccessResponse<AllUsersConsumptionStatisticsDto>>(response => response.IsSuccess, "Whether the operation succeeded.");
ResponseParam<AllUsersConsumptionStatisticsDto>(response => response.Total, "The combined consumption statistics of every user.");
ResponseParam<AllUsersConsumptionStatisticsDto>(response => response.Users, "The consumption statistics of each user, ordered by user Id.");
ResponseParam<ConsumptionTotalsDto>(response => response.TotalConsumedDurationInSeconds, "The total duration consumed over every recorded session of every user, in seconds.");
ResponseParam<ConsumptionTotalsDto>(response => response.CountedSessionCount, "The number of recorded sessions of every user that count towards statistics.");
ResponseParam<ConsumptionTotalsDto>(response => response.CompletedSessionCount, "The number of recorded sessions of every user that completed.");
ResponseParam<ConsumptionTotalsDto>(response => response.StoppedSessionCount, "The number of recorded sessions of every user that stopped before they completed and count towards statistics.");
ResponseParam<ConsumptionTotalsDto>(response => response.CompletionRate, "The fraction of the counted sessions of every user that completed, between 0 and 1, or 0 when there is no counted session.");
ResponseParam<ConsumptionTotalsDto>(response => response.MediaKindSummaries, "The combined consumption statistics broken down by media kind.");
ResponseParam<ConsumptionSummaryDto>(response => response.UserId, "The Id of the user the summary belongs to.");
ResponseParam<ConsumptionSummaryDto>(response => response.TotalConsumedDurationInSeconds, "The total duration consumed over every recorded session of the user, in seconds.");
ResponseParam<ConsumptionSummaryDto>(response => response.CountedSessionCount, "The number of recorded sessions of the user that count towards statistics.");
ResponseParam<ConsumptionSummaryDto>(response => response.CompletedSessionCount, "The number of recorded sessions of the user that completed.");
ResponseParam<ConsumptionSummaryDto>(response => response.StoppedSessionCount, "The number of recorded sessions of the user that stopped before they completed and count towards statistics.");
ResponseParam<ConsumptionSummaryDto>(response => response.CompletionRate, "The fraction of the counted sessions of the user that completed, between 0 and 1, or 0 when there is no counted session.");
ResponseParam<ConsumptionSummaryDto>(response => response.MediaKindSummaries, "The consumption statistics of the user broken down by media kind.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.MediaKind, "The kind of media the breakdown entry belongs to.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.TotalConsumedDurationInSeconds, "The total duration consumed over every recorded session of the media kind, in seconds.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.CountedSessionCount, "The number of recorded sessions of the media kind that count towards statistics.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.CompletedSessionCount, "The number of recorded sessions of the media kind that completed.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.StoppedSessionCount, "The number of recorded sessions of the media kind that stopped before they completed and count towards statistics.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.CompletionRate, "The fraction of the counted sessions of the media kind that completed, between 0 and 1, or 0 when there is no counted session.");
Response(200, "The consumption statistics of every user are returned, or a JSON error with success set to false.",
example: new SuccessResponse<AllUsersConsumptionStatisticsDto>(true, new AllUsersConsumptionStatisticsDto(
Total: new ConsumptionTotalsDto(
TotalConsumedDurationInSeconds: 8744.5,
CountedSessionCount: 6,
CompletedSessionCount: 4,
StoppedSessionCount: 2,
CompletionRate: 0.6667,
MediaKindSummaries:
[
new MediaKindConsumptionSummaryDto(
MediaKind: MediaKind.MusicTrack,
TotalConsumedDurationInSeconds: 1424.5,
CountedSessionCount: 4,
CompletedSessionCount: 3,
StoppedSessionCount: 1,
CompletionRate: 0.75
),
new MediaKindConsumptionSummaryDto(
MediaKind: MediaKind.Book,
TotalConsumedDurationInSeconds: 7320,
CountedSessionCount: 2,
CompletedSessionCount: 1,
StoppedSessionCount: 1,
CompletionRate: 0.5
)
]),
Users:
[
new ConsumptionSummaryDto(
UserId: Guid.Parse("1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d"),
TotalConsumedDurationInSeconds: 8744.5,
CountedSessionCount: 6,
CompletedSessionCount: 4,
StoppedSessionCount: 2,
CompletionRate: 0.6667,
MediaKindSummaries:
[
new MediaKindConsumptionSummaryDto(
MediaKind: MediaKind.MusicTrack,
TotalConsumedDurationInSeconds: 1424.5,
CountedSessionCount: 4,
CompletedSessionCount: 3,
StoppedSessionCount: 1,
CompletionRate: 0.75
)
])
]))
);
}
}
@@ -0,0 +1,86 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetConsumptionStatistics;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-get-statistics</c> route.
/// </summary>
public class GetConsumptionStatisticsEndpoint : BaseEndpoint<GetConsumptionStatisticsRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetConsumptionStatisticsEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetConsumptionStatisticsEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.LibraryStatistics.GET_STATISTICS);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
}
/// <summary>
/// Retrieves the consumption statistics of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user and the optional filters.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetConsumptionStatisticsRequest request, CancellationToken cancellationToken)
{
// The statistics belong to the selected user, so no intermediary may store them, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
ConsumptionSummaryDto response = await _apiHttpClient.GetAsync<ConsumptionSummaryDto>(BuildStatisticsEndpoint(request), cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
/// <summary>
/// Builds the API endpoint used to retrieve the consumption statistics of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user and the optional filters.</param>
/// <returns>The API endpoint to which the statistics request is sent.</returns>
private static string BuildStatisticsEndpoint(GetConsumptionStatisticsRequest request)
{
// The query string is rebuilt from the typed request values instead of forwarding the raw one, so that crafted text can never alter the upstream URL.
StringBuilder endpoint = new(string.IsNullOrWhiteSpace(request.UserId)
? ApiRoutes.LibraryStatistics.GET_CONSUMPTION_STATISTICS
: ApiRoutes.LibraryStatistics.GET_USER_CONSUMPTION_STATISTICS.Replace("{userId}", Uri.EscapeDataString(request.UserId), StringComparison.Ordinal));
List<string> parameters = [];
if (!string.IsNullOrWhiteSpace(request.LibraryId))
parameters.Add($"libraryId={Uri.EscapeDataString(request.LibraryId)}");
if (request.MediaKind is not null)
parameters.Add($"mediaKind={Uri.EscapeDataString(request.MediaKind.Value.ToString())}");
if (request.FromUtc is not null)
parameters.Add($"fromUtc={Uri.EscapeDataString(request.FromUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
if (request.ToUtc is not null)
parameters.Add($"toUtc={Uri.EscapeDataString(request.ToUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
if (parameters.Count > 0)
endpoint.Append('?').Append(string.Join('&', parameters));
return endpoint.ToString();
}
}
@@ -0,0 +1,86 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetConsumptionStatistics;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetConsumptionStatisticsEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetConsumptionStatisticsEndpointSummary : Summary<GetConsumptionStatisticsEndpoint, GetConsumptionStatisticsRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetConsumptionStatisticsEndpointSummary"/> class.
/// </summary>
public GetConsumptionStatisticsEndpointSummary()
{
Summary = "Gets the consumption statistics of the selected user.";
Description = "Proxies the request that gets the total consumed duration, the counted sessions, the completed sessions, the stopped sessions, the completion rate, and the per media kind breakdown of the selected user to the API server. When userId is omitted, the statistics of the current user are returned; an administrator can name another user. The date range is inclusive. A failure is returned as a JSON object with success set to false and a localized errorMessage.";
ExampleRequest = new GetConsumptionStatisticsRequest(
UserId: null,
LibraryId: null,
MediaKind: null,
FromUtc: new DateTime(2026, 10, 1, 0, 0, 0, DateTimeKind.Utc),
ToUtc: new DateTime(2026, 10, 31, 23, 59, 59, DateTimeKind.Utc)
);
RequestParam(request => request.UserId, "The Id of the user whose statistics are retrieved. Optional; when omitted, the current user is used.");
RequestParam(request => request.LibraryId, "The Id of the media library to restrict the statistics to. Optional.");
RequestParam(request => request.MediaKind, "The kind of media to restrict the statistics to. Optional.");
RequestParam(request => request.FromUtc, "The inclusive start of the date range. Optional.");
RequestParam(request => request.ToUtc, "The inclusive end of the date range. Optional.");
ResponseParam<SuccessResponse<ConsumptionSummaryDto>>(response => response.IsSuccess, "Whether the operation succeeded.");
ResponseParam<ConsumptionSummaryDto>(response => response.UserId, "The Id of the user the statistics belong to.");
ResponseParam<ConsumptionSummaryDto>(response => response.TotalConsumedDurationInSeconds, "The total duration consumed over every recorded session, in seconds.");
ResponseParam<ConsumptionSummaryDto>(response => response.CountedSessionCount, "The number of recorded sessions that count towards statistics.");
ResponseParam<ConsumptionSummaryDto>(response => response.CompletedSessionCount, "The number of recorded sessions that completed.");
ResponseParam<ConsumptionSummaryDto>(response => response.StoppedSessionCount, "The number of recorded sessions that stopped before they completed and count towards statistics.");
ResponseParam<ConsumptionSummaryDto>(response => response.CompletionRate, "The fraction of the counted sessions that completed, between 0 and 1, or 0 when there is no counted session.");
ResponseParam<ConsumptionSummaryDto>(response => response.MediaKindSummaries, "The consumption statistics broken down by media kind.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.MediaKind, "The kind of media the breakdown entry belongs to.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.TotalConsumedDurationInSeconds, "The total duration consumed over every recorded session of the media kind, in seconds.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.CountedSessionCount, "The number of recorded sessions of the media kind that count towards statistics.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.CompletedSessionCount, "The number of recorded sessions of the media kind that completed.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.StoppedSessionCount, "The number of recorded sessions of the media kind that stopped before they completed and count towards statistics.");
ResponseParam<MediaKindConsumptionSummaryDto>(response => response.CompletionRate, "The fraction of the counted sessions of the media kind that completed, between 0 and 1, or 0 when there is no counted session.");
Response(200, "The consumption statistics of the selected user are returned, or a JSON error with success set to false.",
example: new SuccessResponse<ConsumptionSummaryDto>(true, new ConsumptionSummaryDto(
UserId: Guid.Parse("1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d"),
TotalConsumedDurationInSeconds: 8744.5,
CountedSessionCount: 6,
CompletedSessionCount: 4,
StoppedSessionCount: 2,
CompletionRate: 0.6667,
MediaKindSummaries:
[
new MediaKindConsumptionSummaryDto(
MediaKind: MediaKind.MusicTrack,
TotalConsumedDurationInSeconds: 1424.5,
CountedSessionCount: 4,
CompletedSessionCount: 3,
StoppedSessionCount: 1,
CompletionRate: 0.75
),
new MediaKindConsumptionSummaryDto(
MediaKind: MediaKind.Book,
TotalConsumedDurationInSeconds: 7320,
CountedSessionCount: 2,
CompletedSessionCount: 1,
StoppedSessionCount: 1,
CompletionRate: 0.5
)
]))
);
}
}
@@ -0,0 +1,86 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetGenreConsumption;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-get-genre-consumption</c> route.
/// </summary>
public class GetGenreConsumptionEndpoint : BaseEndpoint<GetGenreConsumptionRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetGenreConsumptionEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetGenreConsumptionEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.LibraryStatistics.GET_GENRE_CONSUMPTION);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
}
/// <summary>
/// Retrieves the genre consumption of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user and the optional filters.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetGenreConsumptionRequest request, CancellationToken cancellationToken)
{
// The statistics belong to the selected user, so no intermediary may store them, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
GenreConsumptionDto[] response = await _apiHttpClient.GetAsync<GenreConsumptionDto[]>(BuildGenreConsumptionEndpoint(request), cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
/// <summary>
/// Builds the API endpoint used to retrieve the genre consumption of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user and the optional filters.</param>
/// <returns>The API endpoint to which the genre request is sent.</returns>
private static string BuildGenreConsumptionEndpoint(GetGenreConsumptionRequest request)
{
// The query string is rebuilt from the typed request values instead of forwarding the raw one, so that crafted text can never alter the upstream URL.
StringBuilder endpoint = new(string.IsNullOrWhiteSpace(request.UserId)
? ApiRoutes.LibraryStatistics.GET_GENRE_CONSUMPTION
: ApiRoutes.LibraryStatistics.GET_USER_GENRE_CONSUMPTION.Replace("{userId}", Uri.EscapeDataString(request.UserId), StringComparison.Ordinal));
List<string> parameters = [];
if (!string.IsNullOrWhiteSpace(request.LibraryId))
parameters.Add($"libraryId={Uri.EscapeDataString(request.LibraryId)}");
if (request.MediaKind is not null)
parameters.Add($"mediaKind={Uri.EscapeDataString(request.MediaKind.Value.ToString())}");
if (request.FromUtc is not null)
parameters.Add($"fromUtc={Uri.EscapeDataString(request.FromUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
if (request.ToUtc is not null)
parameters.Add($"toUtc={Uri.EscapeDataString(request.ToUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
if (parameters.Count > 0)
endpoint.Append('?').Append(string.Join('&', parameters));
return endpoint.ToString();
}
}
@@ -0,0 +1,64 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetGenreConsumption;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetGenreConsumptionEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetGenreConsumptionEndpointSummary : Summary<GetGenreConsumptionEndpoint, GetGenreConsumptionRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetGenreConsumptionEndpointSummary"/> class.
/// </summary>
public GetGenreConsumptionEndpointSummary()
{
Summary = "Gets the genre consumption of the selected user.";
Description = "Proxies the request that gets the genres carried by the media items the selected user consumed to the API server. When userId is omitted, the statistics of the current user are returned; an administrator can name another user. The names are lowercase and grouped across media kinds, so a genre shared by a book and a track appears in one bucket. The date range is inclusive. A failure is returned as a JSON object with success set to false and a localized errorMessage.";
ExampleRequest = new GetGenreConsumptionRequest(
UserId: null,
LibraryId: null,
MediaKind: null,
FromUtc: new DateTime(2026, 10, 1, 0, 0, 0, DateTimeKind.Utc),
ToUtc: new DateTime(2026, 10, 31, 23, 59, 59, DateTimeKind.Utc)
);
RequestParam(request => request.UserId, "The Id of the user whose statistics are retrieved. Optional; when omitted, the current user is used.");
RequestParam(request => request.LibraryId, "The Id of the media library to restrict the statistics to. Optional.");
RequestParam(request => request.MediaKind, "The kind of media to restrict the statistics to. Optional.");
RequestParam(request => request.FromUtc, "The inclusive start of the date range. Optional.");
RequestParam(request => request.ToUtc, "The inclusive end of the date range. Optional.");
ResponseParam<SuccessResponse<GenreConsumptionDto[]>>(response => response.IsSuccess, "Whether the operation succeeded.");
ResponseParam<GenreConsumptionDto>(response => response.Name, "The lowercase name of the genre.");
ResponseParam<GenreConsumptionDto>(response => response.ConsumedItemCount, "The number of distinct media items that carry the genre and were consumed.");
ResponseParam<GenreConsumptionDto>(response => response.ConsumedDurationInSeconds, "The active duration consumed in the media items that carry the genre, in seconds.");
Response(200, "The genre consumption of the selected user is returned, or a JSON error with success set to false.",
example: new SuccessResponse<GenreConsumptionDto[]>(true,
[
new GenreConsumptionDto(
Name: "horror",
ConsumedItemCount: 3,
ConsumedDurationInSeconds: 5400),
new GenreConsumptionDto(
Name: "fantasy",
ConsumedItemCount: 2,
ConsumedDurationInSeconds: 7320),
new GenreConsumptionDto(
Name: "science fiction",
ConsumedItemCount: 1,
ConsumedDurationInSeconds: 1424.5)
])
);
}
}
@@ -1,28 +1,29 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary.PlayHistory;
using Lumina.Presentation.Web.Common.DTO.Libraries;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetMusicPlayStatistics;
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetLibraries;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-get-music-play-statistics</c> route.
/// API endpoint for the <c>/{culture}/library/statistics/api-get-libraries</c> route.
/// </summary>
public class GetMusicPlayStatisticsEndpoint : BaseEndpoint<EmptyRequest, IResult>
public class GetLibrariesEndpoint : BaseEndpoint<EmptyRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetMusicPlayStatisticsEndpoint"/> class.
/// Initializes a new instance of the <see cref="GetLibrariesEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetMusicPlayStatisticsEndpoint(IApiHttpClient apiHttpClient)
public GetLibrariesEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
@@ -34,22 +35,22 @@ public class GetMusicPlayStatisticsEndpoint : BaseEndpoint<EmptyRequest, IResult
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.LibraryStatistics.GET_MUSIC_PLAY_STATISTICS);
Routes(WebRoutes.LibraryStatistics.GET_LIBRARIES);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
}
/// <summary>
/// Retrieves the listening statistics of the current user.
/// Retrieves the libraries available for the library filter.
/// </summary>
/// <param name="request">The request object.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken)
{
// The statistics belong to the authenticated user, so no intermediary may store them, and the response varies by the sign in cookie.
// The library list belongs to the current user, so no intermediary may store it, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
MusicPlayStatisticsDto statistics = await _apiHttpClient.GetAsync<MusicPlayStatisticsDto>(ApiRoutes.PlayStatistics.GET_MUSIC_PLAY_STATISTICS, cancellationToken).ConfigureAwait(false);
return JsonSuccess(statistics);
LibraryDto[] response = await _apiHttpClient.GetAsync<LibraryDto[]>(ApiRoutes.Libraries.GET_ENABLED_LIBRARIES, cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
}
@@ -0,0 +1,27 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.Libraries;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetLibraries;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetLibrariesEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetLibrariesEndpointSummary : Summary<GetLibrariesEndpoint, EmptyRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetLibrariesEndpointSummary"/> class.
/// </summary>
public GetLibrariesEndpointSummary()
{
Summary = "Gets the enabled libraries available for the library filter.";
Description = "Proxies the request that gets the enabled media libraries available to the current user to the API server. A regular user receives only their own libraries; an administrator receives every enabled library. A failure is returned as a JSON object with success set to false and a localized errorMessage.";
Response(200, "The enabled media libraries are returned, or a JSON error with success set to false.",
example: new SuccessResponse<LibraryDto[]>(true, default));
}
}
@@ -0,0 +1,92 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetMostConsumed;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-get-most-consumed</c> route.
/// </summary>
public class GetMostConsumedEndpoint : BaseEndpoint<GetMostConsumedRequest, IResult>
{
private const int DEFAULT_PAGE_SIZE = 10;
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetMostConsumedEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetMostConsumedEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.LibraryStatistics.GET_MOST_CONSUMED);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
}
/// <summary>
/// Retrieves a page of the most consumed media items of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user, the optional filters, and the page bounds.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetMostConsumedRequest request, CancellationToken cancellationToken)
{
// The history belongs to the selected user, so no intermediary may store it, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
PaginatedDto<ConsumedItemDto> response = await _apiHttpClient.GetAsync<PaginatedDto<ConsumedItemDto>>(BuildHistoryEndpoint(request), cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
/// <summary>
/// Builds the API endpoint used to retrieve the most consumed media items of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user, the optional filters, and the page bounds.</param>
/// <returns>The API endpoint to which the history request is sent.</returns>
private static string BuildHistoryEndpoint(GetMostConsumedRequest request)
{
// The query string is rebuilt from the typed request values instead of forwarding the raw one, so that crafted text can never alter the upstream URL.
StringBuilder endpoint = new(string.IsNullOrWhiteSpace(request.UserId)
? ApiRoutes.LibraryStatistics.GET_MOST_CONSUMED
: ApiRoutes.LibraryStatistics.GET_USER_MOST_CONSUMED.Replace("{userId}", Uri.EscapeDataString(request.UserId), StringComparison.Ordinal));
int currentPage = request.CurrentPage ?? 1;
int perPage = request.PerPage ?? DEFAULT_PAGE_SIZE;
List<string> parameters = [];
if (!string.IsNullOrWhiteSpace(request.LibraryId))
parameters.Add($"libraryId={Uri.EscapeDataString(request.LibraryId)}");
if (request.MediaKind is not null)
parameters.Add($"mediaKind={Uri.EscapeDataString(request.MediaKind.Value.ToString())}");
if (request.FromUtc is not null)
parameters.Add($"fromUtc={Uri.EscapeDataString(request.FromUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
if (request.ToUtc is not null)
parameters.Add($"toUtc={Uri.EscapeDataString(request.ToUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
parameters.Add($"currentPage={currentPage.ToString(CultureInfo.InvariantCulture)}");
parameters.Add($"perPage={perPage.ToString(CultureInfo.InvariantCulture)}");
endpoint.Append('?').Append(string.Join('&', parameters));
return endpoint.ToString();
}
}
@@ -0,0 +1,102 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetMostConsumed;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetMostConsumedEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetMostConsumedEndpointSummary : Summary<GetMostConsumedEndpoint, GetMostConsumedRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetMostConsumedEndpointSummary"/> class.
/// </summary>
public GetMostConsumedEndpointSummary()
{
Summary = "Gets the most consumed media items of the selected user.";
Description = "Proxies the request that gets a page of the most consumed media items of the selected user to the API server. When userId is omitted, the history of the current user is returned; an administrator can name another user. The items are ordered by counted sessions, consumed duration, last consumption date, and media item Id. Music and book sessions appear in the same list. The date range is inclusive. An item whose media item was deleted, or whose library is no longer accessible, is returned with isAvailable set to false and empty display fields. A failure is returned as a JSON object with success set to false and a localized errorMessage.";
ExampleRequest = new GetMostConsumedRequest(
UserId: null,
LibraryId: null,
MediaKind: null,
FromUtc: new DateTime(2026, 10, 1, 0, 0, 0, DateTimeKind.Utc),
ToUtc: new DateTime(2026, 10, 31, 23, 59, 59, DateTimeKind.Utc),
CurrentPage: 1,
PerPage: 10
);
RequestParam(request => request.UserId, "The Id of the user whose history is retrieved. Optional; when omitted, the current user is used.");
RequestParam(request => request.LibraryId, "The Id of the media library to restrict the history to. Optional.");
RequestParam(request => request.MediaKind, "The kind of media to restrict the history to. Optional.");
RequestParam(request => request.FromUtc, "The inclusive start of the date range. Optional.");
RequestParam(request => request.ToUtc, "The inclusive end of the date range. Optional.");
RequestParam(request => request.CurrentPage, "The one based page of media items to return. Optional. Defaults to 1.");
RequestParam(request => request.PerPage, "The number of media items per page. Optional. Defaults to 10.");
ResponseParam<SuccessResponse<PaginatedDto<ConsumedItemDto>>>(response => response.IsSuccess, "Whether the operation succeeded.");
ResponseParam<PaginatedDto<ConsumedItemDto>>(response => response.Data, "The most consumed media items of the requested page, ordered by counted sessions, consumed duration, last consumption date, and media item Id.");
ResponseParam<PaginatedDto<ConsumedItemDto>>(response => response.CurrentPage, "The current page number.");
ResponseParam<PaginatedDto<ConsumedItemDto>>(response => response.PerPage, "The number of media items retrieved per page.");
ResponseParam<PaginatedDto<ConsumedItemDto>>(response => response.Count, "The total number of distinct media items that match the filters.");
ResponseParam<PaginatedDto<ConsumedItemDto>>(response => response.NumberOfPages, "The total number of pages.");
ResponseParam<ConsumedItemDto>(response => response.MediaKind, "The kind of the consumed media item.");
ResponseParam<ConsumedItemDto>(response => response.MediaItemId, "The Id of the consumed media item.");
ResponseParam<ConsumedItemDto>(response => response.LibraryId, "The Id of the media library that contains the media item.");
ResponseParam<ConsumedItemDto>(response => response.IsAvailable, "Whether the media item still exists and its library is accessible.");
ResponseParam<ConsumedItemDto>(response => response.Title, "The title of the media item, or an empty string when the item is not available.");
ResponseParam<ConsumedItemDto>(response => response.CollectionTitle, "The title of the collection that contains the media item, or an empty string when there is none.");
ResponseParam<ConsumedItemDto>(response => response.CreatorName, "The name of the creator of the media item, or an empty string when there is none.");
ResponseParam<ConsumedItemDto>(response => response.CoverPath, "The path of the cover art of the media item, if available.");
ResponseParam<ConsumedItemDto>(response => response.LastConsumedOnUtc, "The date and time when the media item was last consumed.");
ResponseParam<ConsumedItemDto>(response => response.CountedSessionCount, "The number of consumption sessions of the media item that count towards statistics.");
ResponseParam<ConsumedItemDto>(response => response.CompletedSessionCount, "The number of consumption sessions of the media item that completed.");
ResponseParam<ConsumedItemDto>(response => response.ConsumedDurationInSeconds, "The active duration consumed in the media item, over all of its sessions, in seconds.");
Response(200, "The requested page of most consumed media items is returned, or a JSON error with success set to false.",
example: new SuccessResponse<PaginatedDto<ConsumedItemDto>>(true, new PaginatedDto<ConsumedItemDto>(
Data:
[
new ConsumedItemDto(
MediaKind: MediaKind.MusicTrack,
MediaItemId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"),
LibraryId: Guid.Parse("3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a"),
IsAvailable: true,
Title: "The Show Must Go On",
CollectionTitle: "Innuendo",
CreatorName: "Queen",
CoverPath: "/artwork/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/cover.jpg",
LastConsumedOnUtc: new DateTime(2026, 10, 24, 12, 12, 0, DateTimeKind.Utc),
CountedSessionCount: 4,
CompletedSessionCount: 3,
ConsumedDurationInSeconds: 1424.5),
new ConsumedItemDto(
MediaKind: MediaKind.Book,
MediaItemId: Guid.Parse("7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d"),
LibraryId: Guid.Parse("6c7d8e9f-0a1b-4c2d-9e3f-4a5b6c7d8e9f"),
IsAvailable: true,
Title: "The Fellowship of the Ring",
CollectionTitle: string.Empty,
CreatorName: "J. R. R. Tolkien",
CoverPath: "/artwork/books/7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d/cover.jpg",
LastConsumedOnUtc: new DateTime(2026, 10, 23, 20, 40, 0, DateTimeKind.Utc),
CountedSessionCount: 2,
CompletedSessionCount: 1,
ConsumedDurationInSeconds: 7320)
],
CurrentPage: 1,
PerPage: 10,
Count: 2,
NumberOfPages: 1))
);
}
}
@@ -1,64 +0,0 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary.PlayHistory;
using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.PlayHistory;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Http;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetMostPlayed;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-get-most-played</c> route.
/// </summary>
public class GetMostPlayedEndpoint : BaseEndpoint<GetMostPlayedRequest, IResult>
{
private const int DEFAULT_PAGE_SIZE = 10;
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetMostPlayedEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetMostPlayedEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.LibraryStatistics.GET_MOST_PLAYED);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
}
/// <summary>
/// Retrieves a page of the most played tracks of the current user.
/// </summary>
/// <param name="request">The request object.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetMostPlayedRequest request, CancellationToken cancellationToken)
{
// The statistics belong to the authenticated user, so no intermediary may store them, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
// The query string is rebuilt from the typed request values instead of forwarding the raw one, so that crafted text can never alter the upstream URL.
int currentPage = request.CurrentPage ?? 1;
int perPage = request.PerPage ?? DEFAULT_PAGE_SIZE;
string url = ApiRoutes.PlayStatistics.GET_MOST_PLAYED + $"?currentPage={currentPage.ToString(CultureInfo.InvariantCulture)}&perPage={perPage.ToString(CultureInfo.InvariantCulture)}";
PaginatedDto<PlayedTrackDto> mostPlayed = await _apiHttpClient.GetAsync<PaginatedDto<PlayedTrackDto>>(url, cancellationToken).ConfigureAwait(false);
return JsonSuccess(mostPlayed);
}
}
@@ -1,73 +0,0 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary.PlayHistory;
using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.PlayHistory;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetMostPlayed;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetMostPlayedEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetMostPlayedEndpointSummary : Summary<GetMostPlayedEndpoint, GetMostPlayedRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetMostPlayedEndpointSummary"/> class.
/// </summary>
public GetMostPlayedEndpointSummary()
{
Summary = "Gets the most played tracks of the current user.";
Description = "Proxies the request that gets a page of the most played tracks of the current user to the API server. Each track is returned once, from the most played, with its counted plays, its completed plays and the duration the user listened to it.";
ExampleRequest = new GetMostPlayedRequest(CurrentPage: 1, PerPage: 10);
RequestParam(request => request.CurrentPage, "The one based page of tracks to return. Optional. Defaults to 1.");
RequestParam(request => request.PerPage, "The number of tracks per page. Optional. Defaults to 10.");
ResponseParam<SuccessResponse<PaginatedDto<PlayedTrackDto>>>(response => response.IsSuccess, "Whether the operation succeeded.");
ResponseParam<PaginatedDto<PlayedTrackDto>>(response => response.Data, "The most played tracks of the requested page, ordered by counted plays, listened duration, last activity, and track Id.");
ResponseParam<PaginatedDto<PlayedTrackDto>>(response => response.CurrentPage, "The current page number.");
ResponseParam<PaginatedDto<PlayedTrackDto>>(response => response.PerPage, "The number of tracks retrieved per page.");
ResponseParam<PaginatedDto<PlayedTrackDto>>(response => response.Count, "The total number of tracks that match the filters.");
ResponseParam<PaginatedDto<PlayedTrackDto>>(response => response.NumberOfPages, "The total number of pages.");
ResponseParam<PlayedTrackDto>(response => response.TrackId, "The Id of the track.");
ResponseParam<PlayedTrackDto>(response => response.LibraryId, "The Id of the media library that contains the track.");
ResponseParam<PlayedTrackDto>(response => response.AlbumId, "The Id of the album that contains the track.");
ResponseParam<PlayedTrackDto>(response => response.ArtistId, "The Id of the artist that produced the track.");
ResponseParam<PlayedTrackDto>(response => response.Title, "The title of the track, if it still exists and the user can access its library.");
ResponseParam<PlayedTrackDto>(response => response.AlbumTitle, "The title of the album that contains the track, if available.");
ResponseParam<PlayedTrackDto>(response => response.ArtistName, "The name of the artist that produced the track, if available.");
ResponseParam<PlayedTrackDto>(response => response.CoverPath, "The path of the cover art of the album, if available.");
ResponseParam<PlayedTrackDto>(response => response.LastPlayedOnUtc, "The date and time of the last recorded activity of the track's most recent play.");
ResponseParam<PlayedTrackDto>(response => response.PlayCount, "The number of plays of the track that count as plays.");
ResponseParam<PlayedTrackDto>(response => response.CompletedPlayCount, "The number of plays of the track that completed.");
ResponseParam<PlayedTrackDto>(response => response.ListenedDurationInSeconds, "The duration the user listened to the track, over all of its counted plays, in seconds.");
Response(200, "The requested page of most played tracks is returned.",
example: new SuccessResponse<PaginatedDto<PlayedTrackDto>>(true, new PaginatedDto<PlayedTrackDto>(
Data:
[
new PlayedTrackDto(
TrackId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"),
LibraryId: Guid.Parse("3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a"),
AlbumId: Guid.Parse("e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f"),
ArtistId: Guid.Parse("d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a"),
Title: "Time",
AlbumTitle: "The Dark Side of the Moon",
ArtistName: "Pink Floyd",
CoverPath: "covers/dark-side-of-the-moon.jpg",
LastPlayedOnUtc: new DateTime(2026, 10, 20, 18, 30, 0, DateTimeKind.Utc),
PlayCount: 12,
CompletedPlayCount: 9,
ListenedDurationInSeconds: 4230.5)
],
CurrentPage: 1,
PerPage: 10,
Count: 1,
NumberOfPages: 1))
);
}
}
@@ -1,40 +0,0 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary.PlayHistory;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetMusicPlayStatistics;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetMusicPlayStatisticsEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetMusicPlayStatisticsEndpointSummary : Summary<GetMusicPlayStatisticsEndpoint>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetMusicPlayStatisticsEndpointSummary"/> class.
/// </summary>
public GetMusicPlayStatisticsEndpointSummary()
{
Summary = "Gets the listening statistics of the current user.";
Description = "Proxies the request that gets the total listening time, the counted plays, the completed plays, the stopped plays that count, and the completion rate of the current user to the API server. A play that is still in progress counts once it reaches the threshold, so the counted total can exceed the completed and stopped plays together.";
ResponseParam<SuccessResponse<MusicPlayStatisticsDto>>(response => response.IsSuccess, "Whether the operation succeeded.");
ResponseParam<MusicPlayStatisticsDto>(response => response.TotalListeningDurationInSeconds, "The total duration the user listened to, over every recorded play, in seconds.");
ResponseParam<MusicPlayStatisticsDto>(response => response.TotalPlayCount, "The number of recorded plays that count as plays. It includes an in-progress play that has already reached the threshold, so it need not equal the completed and stopped plays together.");
ResponseParam<MusicPlayStatisticsDto>(response => response.CompletedPlayCount, "The number of recorded plays that completed.");
ResponseParam<MusicPlayStatisticsDto>(response => response.StoppedPlayCount, "The number of recorded plays that stopped before the track completed and count as plays.");
ResponseParam<MusicPlayStatisticsDto>(response => response.CompletionRate, "The fraction of the counted plays that completed, between 0 and 1, or 0 when there is no counted play.");
Response(200, "The listening statistics of the current user are returned.",
example: new SuccessResponse<MusicPlayStatisticsDto>(true, new MusicPlayStatisticsDto(
TotalListeningDurationInSeconds: 93840.5,
TotalPlayCount: 512,
CompletedPlayCount: 388,
StoppedPlayCount: 124,
CompletionRate: 0.7578125))
);
}
}
@@ -0,0 +1,92 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetRecentlyConsumed;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-get-recently-consumed</c> route.
/// </summary>
public class GetRecentlyConsumedEndpoint : BaseEndpoint<GetRecentlyConsumedRequest, IResult>
{
private const int DEFAULT_PAGE_SIZE = 10;
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetRecentlyConsumedEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetRecentlyConsumedEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.LibraryStatistics.GET_RECENTLY_CONSUMED);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
}
/// <summary>
/// Retrieves a page of the recently consumed media items of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user, the optional filters, and the page bounds.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetRecentlyConsumedRequest request, CancellationToken cancellationToken)
{
// The history belongs to the selected user, so no intermediary may store it, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
PaginatedDto<ConsumedItemDto> response = await _apiHttpClient.GetAsync<PaginatedDto<ConsumedItemDto>>(BuildHistoryEndpoint(request), cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
/// <summary>
/// Builds the API endpoint used to retrieve the recently consumed media items of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user, the optional filters, and the page bounds.</param>
/// <returns>The API endpoint to which the history request is sent.</returns>
private static string BuildHistoryEndpoint(GetRecentlyConsumedRequest request)
{
// The query string is rebuilt from the typed request values instead of forwarding the raw one, so that crafted text can never alter the upstream URL.
StringBuilder endpoint = new(string.IsNullOrWhiteSpace(request.UserId)
? ApiRoutes.LibraryStatistics.GET_RECENTLY_CONSUMED
: ApiRoutes.LibraryStatistics.GET_USER_RECENTLY_CONSUMED.Replace("{userId}", Uri.EscapeDataString(request.UserId), StringComparison.Ordinal));
int currentPage = request.CurrentPage ?? 1;
int perPage = request.PerPage ?? DEFAULT_PAGE_SIZE;
List<string> parameters = [];
if (!string.IsNullOrWhiteSpace(request.LibraryId))
parameters.Add($"libraryId={Uri.EscapeDataString(request.LibraryId)}");
if (request.MediaKind is not null)
parameters.Add($"mediaKind={Uri.EscapeDataString(request.MediaKind.Value.ToString())}");
if (request.FromUtc is not null)
parameters.Add($"fromUtc={Uri.EscapeDataString(request.FromUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
if (request.ToUtc is not null)
parameters.Add($"toUtc={Uri.EscapeDataString(request.ToUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
parameters.Add($"currentPage={currentPage.ToString(CultureInfo.InvariantCulture)}");
parameters.Add($"perPage={perPage.ToString(CultureInfo.InvariantCulture)}");
endpoint.Append('?').Append(string.Join('&', parameters));
return endpoint.ToString();
}
}
@@ -0,0 +1,102 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Enums.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetRecentlyConsumed;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetRecentlyConsumedEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetRecentlyConsumedEndpointSummary : Summary<GetRecentlyConsumedEndpoint, GetRecentlyConsumedRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetRecentlyConsumedEndpointSummary"/> class.
/// </summary>
public GetRecentlyConsumedEndpointSummary()
{
Summary = "Gets the recently consumed media items of the selected user.";
Description = "Proxies the request that gets a page of the recently consumed media items of the selected user to the API server. When userId is omitted, the history of the current user is returned; an administrator can name another user. Music and book sessions appear in the same list. The date range is inclusive. An item whose media item was deleted, or whose library is no longer accessible, is returned with isAvailable set to false and empty display fields. A failure is returned as a JSON object with success set to false and a localized errorMessage.";
ExampleRequest = new GetRecentlyConsumedRequest(
UserId: null,
LibraryId: null,
MediaKind: null,
FromUtc: new DateTime(2026, 10, 1, 0, 0, 0, DateTimeKind.Utc),
ToUtc: new DateTime(2026, 10, 31, 23, 59, 59, DateTimeKind.Utc),
CurrentPage: 1,
PerPage: 10
);
RequestParam(request => request.UserId, "The Id of the user whose history is retrieved. Optional; when omitted, the current user is used.");
RequestParam(request => request.LibraryId, "The Id of the media library to restrict the history to. Optional.");
RequestParam(request => request.MediaKind, "The kind of media to restrict the history to. Optional.");
RequestParam(request => request.FromUtc, "The inclusive start of the date range. Optional.");
RequestParam(request => request.ToUtc, "The inclusive end of the date range. Optional.");
RequestParam(request => request.CurrentPage, "The one based page of media items to return. Optional. Defaults to 1.");
RequestParam(request => request.PerPage, "The number of media items per page. Optional. Defaults to 10.");
ResponseParam<SuccessResponse<PaginatedDto<ConsumedItemDto>>>(response => response.IsSuccess, "Whether the operation succeeded.");
ResponseParam<PaginatedDto<ConsumedItemDto>>(response => response.Data, "The recently consumed media items of the requested page, from the most recently consumed.");
ResponseParam<PaginatedDto<ConsumedItemDto>>(response => response.CurrentPage, "The current page number.");
ResponseParam<PaginatedDto<ConsumedItemDto>>(response => response.PerPage, "The number of media items retrieved per page.");
ResponseParam<PaginatedDto<ConsumedItemDto>>(response => response.Count, "The total number of distinct media items that match the filters.");
ResponseParam<PaginatedDto<ConsumedItemDto>>(response => response.NumberOfPages, "The total number of pages.");
ResponseParam<ConsumedItemDto>(response => response.MediaKind, "The kind of the consumed media item.");
ResponseParam<ConsumedItemDto>(response => response.MediaItemId, "The Id of the consumed media item.");
ResponseParam<ConsumedItemDto>(response => response.LibraryId, "The Id of the media library that contains the media item.");
ResponseParam<ConsumedItemDto>(response => response.IsAvailable, "Whether the media item still exists and its library is accessible.");
ResponseParam<ConsumedItemDto>(response => response.Title, "The title of the media item, or an empty string when the item is not available.");
ResponseParam<ConsumedItemDto>(response => response.CollectionTitle, "The title of the collection that contains the media item, or an empty string when there is none.");
ResponseParam<ConsumedItemDto>(response => response.CreatorName, "The name of the creator of the media item, or an empty string when there is none.");
ResponseParam<ConsumedItemDto>(response => response.CoverPath, "The path of the cover art of the media item, if available.");
ResponseParam<ConsumedItemDto>(response => response.LastConsumedOnUtc, "The date and time when the media item was last consumed.");
ResponseParam<ConsumedItemDto>(response => response.CountedSessionCount, "The number of consumption sessions of the media item that count towards statistics.");
ResponseParam<ConsumedItemDto>(response => response.CompletedSessionCount, "The number of consumption sessions of the media item that completed.");
ResponseParam<ConsumedItemDto>(response => response.ConsumedDurationInSeconds, "The active duration consumed in the media item, over all of its sessions, in seconds.");
Response(200, "The requested page of recently consumed media items is returned, or a JSON error with success set to false.",
example: new SuccessResponse<PaginatedDto<ConsumedItemDto>>(true, new PaginatedDto<ConsumedItemDto>(
Data:
[
new ConsumedItemDto(
MediaKind: MediaKind.MusicTrack,
MediaItemId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"),
LibraryId: Guid.Parse("3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a"),
IsAvailable: true,
Title: "The Show Must Go On",
CollectionTitle: "Innuendo",
CreatorName: "Queen",
CoverPath: "/artwork/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/cover.jpg",
LastConsumedOnUtc: new DateTime(2026, 10, 24, 12, 12, 0, DateTimeKind.Utc),
CountedSessionCount: 4,
CompletedSessionCount: 3,
ConsumedDurationInSeconds: 1424.5),
new ConsumedItemDto(
MediaKind: MediaKind.Book,
MediaItemId: Guid.Parse("7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d"),
LibraryId: Guid.Parse("6c7d8e9f-0a1b-4c2d-9e3f-4a5b6c7d8e9f"),
IsAvailable: true,
Title: "The Fellowship of the Ring",
CollectionTitle: string.Empty,
CreatorName: "J. R. R. Tolkien",
CoverPath: "/artwork/books/7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d/cover.jpg",
LastConsumedOnUtc: new DateTime(2026, 10, 23, 20, 40, 0, DateTimeKind.Utc),
CountedSessionCount: 2,
CompletedSessionCount: 1,
ConsumedDurationInSeconds: 7320)
],
CurrentPage: 1,
PerPage: 10,
Count: 2,
NumberOfPages: 1))
);
}
}
@@ -1,64 +0,0 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary.PlayHistory;
using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.PlayHistory;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Http;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetRecentlyPlayed;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-get-recently-played</c> route.
/// </summary>
public class GetRecentlyPlayedEndpoint : BaseEndpoint<GetRecentlyPlayedRequest, IResult>
{
private const int DEFAULT_PAGE_SIZE = 10;
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetRecentlyPlayedEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetRecentlyPlayedEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.LibraryStatistics.GET_RECENTLY_PLAYED);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
}
/// <summary>
/// Retrieves a page of the recently played tracks of the current user.
/// </summary>
/// <param name="request">The request object.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetRecentlyPlayedRequest request, CancellationToken cancellationToken)
{
// The statistics belong to the authenticated user, so no intermediary may store them, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
// The query string is rebuilt from the typed request values instead of forwarding the raw one, so that crafted text can never alter the upstream URL.
int currentPage = request.CurrentPage ?? 1;
int perPage = request.PerPage ?? DEFAULT_PAGE_SIZE;
string url = ApiRoutes.PlayStatistics.GET_RECENTLY_PLAYED + $"?currentPage={currentPage.ToString(CultureInfo.InvariantCulture)}&perPage={perPage.ToString(CultureInfo.InvariantCulture)}";
PaginatedDto<PlayedTrackDto> recentlyPlayed = await _apiHttpClient.GetAsync<PaginatedDto<PlayedTrackDto>>(url, cancellationToken).ConfigureAwait(false);
return JsonSuccess(recentlyPlayed);
}
}
@@ -1,73 +0,0 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary.PlayHistory;
using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.PlayHistory;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetRecentlyPlayed;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetRecentlyPlayedEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetRecentlyPlayedEndpointSummary : Summary<GetRecentlyPlayedEndpoint, GetRecentlyPlayedRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetRecentlyPlayedEndpointSummary"/> class.
/// </summary>
public GetRecentlyPlayedEndpointSummary()
{
Summary = "Gets the recently played tracks of the current user.";
Description = "Proxies the request that gets a page of the recently played tracks of the current user to the API server. Each track is returned once, from the most recently played, with its counted plays, its completed plays and the duration the user listened to it.";
ExampleRequest = new GetRecentlyPlayedRequest(CurrentPage: 1, PerPage: 10);
RequestParam(request => request.CurrentPage, "The one based page of tracks to return. Optional. Defaults to 1.");
RequestParam(request => request.PerPage, "The number of tracks per page. Optional. Defaults to 10.");
ResponseParam<SuccessResponse<PaginatedDto<PlayedTrackDto>>>(response => response.IsSuccess, "Whether the operation succeeded.");
ResponseParam<PaginatedDto<PlayedTrackDto>>(response => response.Data, "The recently played tracks of the requested page, from the most recently played.");
ResponseParam<PaginatedDto<PlayedTrackDto>>(response => response.CurrentPage, "The current page number.");
ResponseParam<PaginatedDto<PlayedTrackDto>>(response => response.PerPage, "The number of tracks retrieved per page.");
ResponseParam<PaginatedDto<PlayedTrackDto>>(response => response.Count, "The total number of tracks that match the filters.");
ResponseParam<PaginatedDto<PlayedTrackDto>>(response => response.NumberOfPages, "The total number of pages.");
ResponseParam<PlayedTrackDto>(response => response.TrackId, "The Id of the track.");
ResponseParam<PlayedTrackDto>(response => response.LibraryId, "The Id of the media library that contains the track.");
ResponseParam<PlayedTrackDto>(response => response.AlbumId, "The Id of the album that contains the track.");
ResponseParam<PlayedTrackDto>(response => response.ArtistId, "The Id of the artist that produced the track.");
ResponseParam<PlayedTrackDto>(response => response.Title, "The title of the track, if it still exists and the user can access its library.");
ResponseParam<PlayedTrackDto>(response => response.AlbumTitle, "The title of the album that contains the track, if available.");
ResponseParam<PlayedTrackDto>(response => response.ArtistName, "The name of the artist that produced the track, if available.");
ResponseParam<PlayedTrackDto>(response => response.CoverPath, "The path of the cover art of the album, if available.");
ResponseParam<PlayedTrackDto>(response => response.LastPlayedOnUtc, "The date and time of the last recorded activity of the track's most recent play.");
ResponseParam<PlayedTrackDto>(response => response.PlayCount, "The number of plays of the track that count as plays.");
ResponseParam<PlayedTrackDto>(response => response.CompletedPlayCount, "The number of plays of the track that completed.");
ResponseParam<PlayedTrackDto>(response => response.ListenedDurationInSeconds, "The duration the user listened to the track, over all of its counted plays, in seconds.");
Response(200, "The requested page of recently played tracks is returned.",
example: new SuccessResponse<PaginatedDto<PlayedTrackDto>>(true, new PaginatedDto<PlayedTrackDto>(
Data:
[
new PlayedTrackDto(
TrackId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"),
LibraryId: Guid.Parse("3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a"),
AlbumId: Guid.Parse("e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f"),
ArtistId: Guid.Parse("d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a"),
Title: "Time",
AlbumTitle: "The Dark Side of the Moon",
ArtistName: "Pink Floyd",
CoverPath: "covers/dark-side-of-the-moon.jpg",
LastPlayedOnUtc: new DateTime(2026, 10, 20, 18, 30, 0, DateTimeKind.Utc),
PlayCount: 12,
CompletedPlayCount: 9,
ListenedDurationInSeconds: 4230.5)
],
CurrentPage: 1,
PerPage: 10,
Count: 1,
NumberOfPages: 1))
);
}
}
@@ -0,0 +1,86 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetTagConsumption;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-get-tag-consumption</c> route.
/// </summary>
public class GetTagConsumptionEndpoint : BaseEndpoint<GetTagConsumptionRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetTagConsumptionEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetTagConsumptionEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.LibraryStatistics.GET_TAG_CONSUMPTION);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
}
/// <summary>
/// Retrieves the tag consumption of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user and the optional filters.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetTagConsumptionRequest request, CancellationToken cancellationToken)
{
// The statistics belong to the selected user, so no intermediary may store them, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
TagConsumptionDto[] response = await _apiHttpClient.GetAsync<TagConsumptionDto[]>(BuildTagConsumptionEndpoint(request), cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
/// <summary>
/// Builds the API endpoint used to retrieve the tag consumption of the selected user.
/// </summary>
/// <param name="request">The request containing the selected user and the optional filters.</param>
/// <returns>The API endpoint to which the tag request is sent.</returns>
private static string BuildTagConsumptionEndpoint(GetTagConsumptionRequest request)
{
// The query string is rebuilt from the typed request values instead of forwarding the raw one, so that crafted text can never alter the upstream URL.
StringBuilder endpoint = new(string.IsNullOrWhiteSpace(request.UserId)
? ApiRoutes.LibraryStatistics.GET_TAG_CONSUMPTION
: ApiRoutes.LibraryStatistics.GET_USER_TAG_CONSUMPTION.Replace("{userId}", Uri.EscapeDataString(request.UserId), StringComparison.Ordinal));
List<string> parameters = [];
if (!string.IsNullOrWhiteSpace(request.LibraryId))
parameters.Add($"libraryId={Uri.EscapeDataString(request.LibraryId)}");
if (request.MediaKind is not null)
parameters.Add($"mediaKind={Uri.EscapeDataString(request.MediaKind.Value.ToString())}");
if (request.FromUtc is not null)
parameters.Add($"fromUtc={Uri.EscapeDataString(request.FromUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
if (request.ToUtc is not null)
parameters.Add($"toUtc={Uri.EscapeDataString(request.ToUtc.Value.ToString("O", CultureInfo.InvariantCulture))}");
if (parameters.Count > 0)
endpoint.Append('?').Append(string.Join('&', parameters));
return endpoint.ToString();
}
}
@@ -0,0 +1,64 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.Requests.Library.Statistics;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetTagConsumption;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetTagConsumptionEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetTagConsumptionEndpointSummary : Summary<GetTagConsumptionEndpoint, GetTagConsumptionRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetTagConsumptionEndpointSummary"/> class.
/// </summary>
public GetTagConsumptionEndpointSummary()
{
Summary = "Gets the tag consumption of the selected user.";
Description = "Proxies the request that gets the tags carried by the media items the selected user consumed to the API server. When userId is omitted, the statistics of the current user are returned; an administrator can name another user. The names are lowercase and grouped across media kinds, so a tag shared by a book and a track appears in one bucket. The date range is inclusive. A failure is returned as a JSON object with success set to false and a localized errorMessage.";
ExampleRequest = new GetTagConsumptionRequest(
UserId: null,
LibraryId: null,
MediaKind: null,
FromUtc: new DateTime(2026, 10, 1, 0, 0, 0, DateTimeKind.Utc),
ToUtc: new DateTime(2026, 10, 31, 23, 59, 59, DateTimeKind.Utc)
);
RequestParam(request => request.UserId, "The Id of the user whose statistics are retrieved. Optional; when omitted, the current user is used.");
RequestParam(request => request.LibraryId, "The Id of the media library to restrict the statistics to. Optional.");
RequestParam(request => request.MediaKind, "The kind of media to restrict the statistics to. Optional.");
RequestParam(request => request.FromUtc, "The inclusive start of the date range. Optional.");
RequestParam(request => request.ToUtc, "The inclusive end of the date range. Optional.");
ResponseParam<SuccessResponse<TagConsumptionDto[]>>(response => response.IsSuccess, "Whether the operation succeeded.");
ResponseParam<TagConsumptionDto>(response => response.Name, "The lowercase name of the tag.");
ResponseParam<TagConsumptionDto>(response => response.ConsumedItemCount, "The number of distinct media items that carry the tag and were consumed.");
ResponseParam<TagConsumptionDto>(response => response.ConsumedDurationInSeconds, "The active duration consumed in the media items that carry the tag, in seconds.");
Response(200, "The tag consumption of the selected user is returned, or a JSON error with success set to false.",
example: new SuccessResponse<TagConsumptionDto[]>(true,
[
new TagConsumptionDto(
Name: "favourite",
ConsumedItemCount: 3,
ConsumedDurationInSeconds: 5400),
new TagConsumptionDto(
Name: "book-club",
ConsumedItemCount: 2,
ConsumedDurationInSeconds: 7320),
new TagConsumptionDto(
Name: "comfort-read",
ConsumedItemCount: 1,
ConsumedDurationInSeconds: 1424.5)
])
);
}
}
@@ -0,0 +1,58 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Authorization;
using Lumina.Presentation.Web.Common.DTO.UsersManagement;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetUsers;
/// <summary>
/// API endpoint for the <c>/{culture}/library/statistics/api-get-users</c> route.
/// </summary>
public class GetUsersEndpoint : BaseEndpoint<EmptyRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="GetUsersEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public GetUsersEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.LibraryStatistics.GET_USERS);
DontAutoTag();
Options(options => options.WithTags("Statistics"));
Policies(AuthorizationPolicies.REQUIRE_ADMIN_ROLE);
}
/// <summary>
/// Retrieves the users available for the administrator user selector.
/// </summary>
/// <param name="request">The request object.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken)
{
// The user list is administrative data, so no intermediary may store it, and the response varies by the sign in cookie.
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
UserDto[] response = await _apiHttpClient.GetAsync<UserDto[]>(ApiRoutes.Authentication.USERS, cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
}
@@ -0,0 +1,41 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.DTO.UsersManagement;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.Statistics.GetUsers;
/// <summary>
/// Class used for providing a textual description for the <see cref="GetUsersEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetUsersEndpointSummary : Summary<GetUsersEndpoint, EmptyRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="GetUsersEndpointSummary"/> class.
/// </summary>
public GetUsersEndpointSummary()
{
Summary = "Gets the users available for the administrator user selector.";
Description = "Proxies the request that gets the list of users to the API server. Only an administrator can call it. A failure is returned as a JSON object with success set to false and a localized errorMessage.";
ResponseParam<SuccessResponse<UserDto[]>>(response => response.IsSuccess, "Whether the operation succeeded.");
ResponseParam<UserDto>(response => response.Id, "The unique identifier of the user.");
ResponseParam<UserDto>(response => response.Username, "The username of the user.");
Response(200, "The users available for the selector are returned, or a JSON error with success set to false.",
example: new SuccessResponse<UserDto[]>(true,
[
new UserDto(
Id: Guid.Parse("1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d"),
Username: "john.doe"),
new UserDto(
Id: Guid.Parse("2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"),
Username: "jane.doe")
])
);
}
}
@@ -1,5 +1,7 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Authorization;
using Lumina.Presentation.Web.Common.DTO.MediaConsumption;
using Lumina.Presentation.Web.Common.DTO.Themes;
using Lumina.Presentation.Web.Common.Primitives;
using Lumina.Presentation.Web.Common.Routes;
@@ -10,6 +12,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Localization;
using System;
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
#endregion
@@ -30,6 +33,7 @@ public class StatisticsIndexViewEndpoint : BaseEndpoint<EmptyRequest, IResult>
private readonly IUrlService _urlService;
private readonly ThemePageRenderer _themePageRenderer;
private readonly IStringLocalizer _localizer;
private readonly IAuthorizationService _authorizationService;
/// <summary>
/// Initializes a new instance of the <see cref="StatisticsIndexViewEndpoint"/> class.
@@ -37,11 +41,13 @@ public class StatisticsIndexViewEndpoint : BaseEndpoint<EmptyRequest, IResult>
/// <param name="urlService">Injected service for generating URLs from action and controller names, with localization.</param>
/// <param name="themePageRenderer">Injected service for rendering themed pages.</param>
/// <param name="stringLocalizerFactory">Injected factory used to create the localizer of the view resources.</param>
public StatisticsIndexViewEndpoint(IUrlService urlService, ThemePageRenderer themePageRenderer, IStringLocalizerFactory stringLocalizerFactory)
/// <param name="authorizationService">Injected service used to resolve the role of the current user.</param>
public StatisticsIndexViewEndpoint(IUrlService urlService, ThemePageRenderer themePageRenderer, IStringLocalizerFactory stringLocalizerFactory, IAuthorizationService authorizationService)
{
_urlService = urlService;
_themePageRenderer = themePageRenderer;
_localizer = stringLocalizerFactory.Create(VIEW_RESOURCE_BASE_NAME, VIEW_RESOURCE_LOCATION);
_authorizationService = authorizationService;
}
/// <summary>
@@ -57,7 +63,7 @@ public class StatisticsIndexViewEndpoint : BaseEndpoint<EmptyRequest, IResult>
}
/// <summary>
/// Displays the statistics of the current user, rendered by the active theme with a fallback to the Razor view.
/// Displays the statistics page, rendered by the active theme with a fallback to the Razor view.
/// </summary>
/// <param name="request">The request object.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
@@ -67,9 +73,28 @@ public class StatisticsIndexViewEndpoint : BaseEndpoint<EmptyRequest, IResult>
HttpContext.Response.Headers["Cache-Control"] = "private, no-store";
HttpContext.Response.Headers["Vary"] = "Cookie";
string title = _localizer["Title"].Value;
bool isAdmin = await _authorizationService.IsInRoleAsync("Admin", cancellationToken).ConfigureAwait(false);
string? currentUserId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
Guid? parsedCurrentUserId = Guid.TryParse(currentUserId, out Guid userId) ? userId : null;
StatisticsPageDto page = new(
Title: title,
IsAdmin: isAdmin,
CurrentUserId: parsedCurrentUserId,
Culture: Culture,
GetStatisticsUrl: _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.GET_STATISTICS) ?? string.Empty,
GetAllUsersStatisticsUrl: _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.GET_ALL_USERS_STATISTICS) ?? string.Empty,
GetRecentlyConsumedUrl: _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.GET_RECENTLY_CONSUMED) ?? string.Empty,
GetMostConsumedUrl: _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.GET_MOST_CONSUMED) ?? string.Empty,
GetTagConsumptionUrl: _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.GET_TAG_CONSUMPTION) ?? string.Empty,
GetGenreConsumptionUrl: _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.GET_GENRE_CONSUMPTION) ?? string.Empty,
GetLibrariesUrl: _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.GET_LIBRARIES) ?? string.Empty,
GetUsersUrl: isAdmin ? _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.GET_USERS) ?? string.Empty : string.Empty,
DeleteConsumptionItemHistoryUrl: _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.DELETE_CONSUMPTION_ITEM_HISTORY) ?? string.Empty,
ClearConsumptionHistoryUrl: _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.CLEAR_CONSUMPTION_HISTORY) ?? string.Empty,
ClearResumePointsUrl: _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.CLEAR_RESUME_POINTS) ?? string.Empty
);
// The track link template carries the all-zero Guid placeholders of its route values, in route order (artist, album and track), which the
// page replaces one at a time. The detail page of a track expects the Id of its media library in the libraryId query parameter.
ThemePageDto pageModel = new()
{
PageKey = VIEW_PAGE_KEY,
@@ -77,18 +102,27 @@ public class StatisticsIndexViewEndpoint : BaseEndpoint<EmptyRequest, IResult>
Description = string.Empty,
PageData = new Dictionary<string, object?>
{
["getRecentlyPlayedUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.GET_RECENTLY_PLAYED) ?? string.Empty,
["getMostPlayedUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.GET_MOST_PLAYED) ?? string.Empty,
["getStatisticsUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.LibraryStatistics.GET_MUSIC_PLAY_STATISTICS) ?? string.Empty,
["trackUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.TRACK, new { artistId = default(Guid), albumId = default(Guid), trackId = default(Guid) }) ?? string.Empty,
["culture"] = Culture,
["getStatisticsUrl"] = page.GetStatisticsUrl,
["getAllUsersStatisticsUrl"] = page.GetAllUsersStatisticsUrl,
["getRecentlyConsumedUrl"] = page.GetRecentlyConsumedUrl,
["getMostConsumedUrl"] = page.GetMostConsumedUrl,
["getTagConsumptionUrl"] = page.GetTagConsumptionUrl,
["getGenreConsumptionUrl"] = page.GetGenreConsumptionUrl,
["getLibrariesUrl"] = page.GetLibrariesUrl,
["getUsersUrl"] = page.GetUsersUrl,
["deleteConsumptionItemHistoryUrl"] = page.DeleteConsumptionItemHistoryUrl,
["clearConsumptionHistoryUrl"] = page.ClearConsumptionHistoryUrl,
["clearResumePointsUrl"] = page.ClearResumePointsUrl,
["culture"] = page.Culture,
["isAdmin"] = page.IsAdmin,
["currentUserId"] = page.CurrentUserId,
["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer)
}
};
Result<ThemePageRenderResultDto> sectionResult = await _themePageRenderer.RenderAsync(pageModel, requestedThemeId: null, cancellationToken).ConfigureAwait(false);
if (sectionResult.IsFailure)
return View("/Core/Views/Library/Statistics/Index.cshtml", viewData: new Dictionary<string, object?> { ["Title"] = title });
return View("/Core/Views/Library/Statistics/Index.cshtml", page, new Dictionary<string, object?> { ["Title"] = title });
return View("/Core/Views/Shared/_ThemedView.cshtml", new ThemeViewDto(sectionResult.Value.Content, sectionResult.Value.Script), new Dictionary<string, object?> { ["Title"] = title });
}
@@ -17,7 +17,7 @@ public class StatisticsIndexViewEndpointSummary : Summary<StatisticsIndexViewEnd
public StatisticsIndexViewEndpointSummary()
{
Summary = "Renders the statistics page.";
Description = "Renders the page that shows the statistics of the current user: the total listening time, the counted plays, the completed plays, the completion rate, and the recently played and most played tracks.";
Description = "Renders the page that shows the consumption statistics of the selected user: the total consumed duration, the counted sessions, the completed sessions, the stopped sessions, the completion rate, the per media kind breakdown, the tag and genre breakdown, and the recently consumed and most consumed media items. The page filters by library, media kind, and date range. An administrator can select another user or all users; a regular user sees only their own statistics. The page also offers the deletion of a history row, the clearing of the history, and the removal of the resume points.";
Response(200, "The statistics page is rendered.");
}
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -15,29 +15,149 @@
<data name="Title" xml:space="preserve">
<value>الإحصائيات</value>
</data>
<data name="TotalListeningTime" xml:space="preserve">
<value>إجمالي وقت الاستماع</value>
<data name="TotalConsumedDuration" xml:space="preserve">
<value>إجمالي وقت الاستهلاك</value>
</data>
<data name="TotalPlays" xml:space="preserve">
<value>مرات التشغيل</value>
<data name="CountedSessions" xml:space="preserve">
<value>الجلسات المحتسبة</value>
</data>
<data name="CompletedPlays" xml:space="preserve">
<value>مرات التشغيل المكتملة</value>
<data name="CompletedSessions" xml:space="preserve">
<value>الجلسات المكتملة</value>
</data>
<data name="CompletionRate" xml:space="preserve">
<value>معدل الإكمال</value>
</data>
<data name="RecentlyPlayed" xml:space="preserve">
<value>شُغّل مؤخراً</value>
<data name="ByMediaKind" xml:space="preserve">
<value>حسب نوع الوسائط</value>
</data>
<data name="MostPlayed" xml:space="preserve">
<value>الأكثر تشغيلاً</value>
<data name="MediaKind" xml:space="preserve">
<value>نوع الوسائط</value>
</data>
<data name="NoPlaysYet" xml:space="preserve">
<value>لا توجد مرات تشغيل محتسبة بعد.</value>
<data name="Duration" xml:space="preserve">
<value>الوقت</value>
</data>
<data name="Stopped" xml:space="preserve">
<value>متوقفة</value>
</data>
<data name="Counted" xml:space="preserve">
<value>محتسبة</value>
</data>
<data name="Completed" xml:space="preserve">
<value>مكتملة</value>
</data>
<data name="Genres" xml:space="preserve">
<value>الأنواع</value>
</data>
<data name="Tags" xml:space="preserve">
<value>العلامات</value>
</data>
<data name="NoGenres" xml:space="preserve">
<value>لا توجد بيانات أنواع لهذه عوامل التصفية.</value>
</data>
<data name="NoTags" xml:space="preserve">
<value>لا توجد بيانات علامات لهذه عوامل التصفية.</value>
</data>
<data name="Items" xml:space="preserve">
<value>عناصر</value>
</data>
<data name="RecentlyConsumed" xml:space="preserve">
<value>المستهلك مؤخراً</value>
</data>
<data name="MostConsumed" xml:space="preserve">
<value>الأكثر استهلاكاً</value>
</data>
<data name="NoRecentlyConsumed" xml:space="preserve">
<value>لا توجد عناصر مستهلكة مؤخراً.</value>
</data>
<data name="NoMostConsumed" xml:space="preserve">
<value>لا توجد عناصر أكثر استهلاكاً.</value>
</data>
<data name="LastConsumed" xml:space="preserve">
<value>آخر استهلاك</value>
</data>
<data name="Unavailable" xml:space="preserve">
<value>هذا المقطع لم يعد متاحاً.</value>
<value>هذا العنصر لم يعد متاحاً.</value>
</data>
<data name="DeleteFromHistory" xml:space="preserve">
<value>حذف من السجل</value>
</data>
<data name="DeleteFromHistoryConfirm" xml:space="preserve">
<value>هل تريد حذف كل الجلسات المسجلة لهذا العنصر من السجل؟</value>
</data>
<data name="HistoryEntryDeleted" xml:space="preserve">
<value>تم حذف إدخال السجل.</value>
</data>
<data name="ClearHistory" xml:space="preserve">
<value>مسح السجل</value>
</data>
<data name="ClearHistoryConfirm" xml:space="preserve">
<value>هل تريد حذف سجل الاستهلاك بالكامل للمستخدم المحدد؟</value>
</data>
<data name="HistoryCleared" xml:space="preserve">
<value>تم مسح سجل الاستهلاك.</value>
</data>
<data name="ClearResumePoints" xml:space="preserve">
<value>إزالة من متابعة المشاهدة</value>
</data>
<data name="ClearResumePointsConfirm" xml:space="preserve">
<value>هل تريد إزالة كل نقاط الاستئناف للمستخدم المحدد؟ يتم الاحتفاظ بالسجل.</value>
</data>
<data name="ResumePointsCleared" xml:space="preserve">
<value>تمت إزالة نقاط الاستئناف.</value>
</data>
<data name="Filters" xml:space="preserve">
<value>عوامل التصفية</value>
</data>
<data name="Library" xml:space="preserve">
<value>المكتبة</value>
</data>
<data name="AllLibraries" xml:space="preserve">
<value>كل المكتبات</value>
</data>
<data name="AllMediaKinds" xml:space="preserve">
<value>كل أنواع الوسائط</value>
</data>
<data name="From" xml:space="preserve">
<value>من</value>
</data>
<data name="To" xml:space="preserve">
<value>إلى</value>
</data>
<data name="Apply" xml:space="preserve">
<value>تطبيق</value>
</data>
<data name="Reset" xml:space="preserve">
<value>إعادة تعيين</value>
</data>
<data name="InvalidDateRange" xml:space="preserve">
<value>يجب ألا يكون تاريخ البداية بعد تاريخ النهاية.</value>
</data>
<data name="User" xml:space="preserve">
<value>المستخدم</value>
</data>
<data name="AllUsers" xml:space="preserve">
<value>كل المستخدمين</value>
</data>
<data name="Me" xml:space="preserve">
<value>أنا</value>
</data>
<data name="AllUsersHistoryUnavailable" xml:space="preserve">
<value>السجل وتفصيل العلامات متاحان لكل مستخدم. اختر مستخدماً لعرضهما.</value>
</data>
<data name="PerUser" xml:space="preserve">
<value>لكل مستخدم</value>
</data>
<data name="NoUsers" xml:space="preserve">
<value>لا يوجد مستخدمون لديهم إحصائيات استهلاك لهذه عوامل التصفية.</value>
</data>
<data name="NoMediaKindData" xml:space="preserve">
<value>لا توجد بيانات نوع وسائط لهذه عوامل التصفية.</value>
</data>
<data name="NoConsumption" xml:space="preserve">
<value>لا يوجد سجل استهلاك لهذه عوامل التصفية.</value>
</data>
<data name="Loading" xml:space="preserve">
<value>جارٍ التحميل...</value>
</data>
<data name="LoadFailed" xml:space="preserve">
<value>تعذر تحميل الإحصائيات.</value>
@@ -45,20 +165,29 @@
<data name="Retry" xml:space="preserve">
<value>إعادة المحاولة</value>
</data>
<data name="Plays" xml:space="preserve">
<value>مرات تشغيل</value>
<data name="KindMusicTrack" xml:space="preserve">
<value>مقطع</value>
</data>
<data name="Completed" xml:space="preserve">
<value>مكتملة</value>
<data name="KindPodcastEpisode" xml:space="preserve">
<value>حلقة بودكاست</value>
</data>
<data name="LastPlayed" xml:space="preserve">
<value>آخر تشغيل</value>
<data name="KindAudiobook" xml:space="preserve">
<value>كتاب صوتي</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>تشغيل المقطع</value>
<data name="KindMovie" xml:space="preserve">
<value>فيلم</value>
</data>
<data name="AddToPlaylist" xml:space="preserve">
<value>إضافة إلى قائمة التشغيل</value>
<data name="KindTvEpisode" xml:space="preserve">
<value>حلقة تلفزيونية</value>
</data>
<data name="KindBook" xml:space="preserve">
<value>كتاب</value>
</data>
<data name="KindPhoto" xml:space="preserve">
<value>صورة</value>
</data>
<data name="KindVideo" xml:space="preserve">
<value>فيديو</value>
</data>
<data name="HoursShort" xml:space="preserve">
<value>س</value>
@@ -69,4 +198,4 @@
<data name="SecondsShort" xml:space="preserve">
<value>ث</value>
</data>
</root>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -15,58 +15,187 @@
<data name="Title" xml:space="preserve">
<value>Statistik</value>
</data>
<data name="TotalListeningTime" xml:space="preserve">
<value>Gesamte Hörzeit</value>
<data name="TotalConsumedDuration" xml:space="preserve">
<value>Gesamte konsumierte Zeit</value>
</data>
<data name="TotalPlays" xml:space="preserve">
<value>Wiedergaben</value>
<data name="CountedSessions" xml:space="preserve">
<value>Gezählte Sitzungen</value>
</data>
<data name="CompletedPlays" xml:space="preserve">
<value>Abgeschlossene Wiedergaben</value>
<data name="CompletedSessions" xml:space="preserve">
<value>Abgeschlossene Sitzungen</value>
</data>
<data name="CompletionRate" xml:space="preserve">
<value>Abschlussrate</value>
</data>
<data name="RecentlyPlayed" xml:space="preserve">
<value>Zuletzt gehört</value>
<data name="ByMediaKind" xml:space="preserve">
<value>Nach Medienart</value>
</data>
<data name="MostPlayed" xml:space="preserve">
<value>Meistgehört</value>
<data name="MediaKind" xml:space="preserve">
<value>Medienart</value>
</data>
<data name="NoPlaysYet" xml:space="preserve">
<value>Es gibt noch keine gezählten Wiedergaben.</value>
<data name="Duration" xml:space="preserve">
<value>Zeit</value>
</data>
<data name="Stopped" xml:space="preserve">
<value>Gestoppt</value>
</data>
<data name="Counted" xml:space="preserve">
<value>Gezählt</value>
</data>
<data name="Completed" xml:space="preserve">
<value>Abgeschlossen</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Genres</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Tags</value>
</data>
<data name="NoGenres" xml:space="preserve">
<value>Keine Genre-Daten für diese Filter.</value>
</data>
<data name="NoTags" xml:space="preserve">
<value>Keine Tag-Daten für diese Filter.</value>
</data>
<data name="Items" xml:space="preserve">
<value>Elemente</value>
</data>
<data name="RecentlyConsumed" xml:space="preserve">
<value>Kürzlich konsumiert</value>
</data>
<data name="MostConsumed" xml:space="preserve">
<value>Meistkonsumiert</value>
</data>
<data name="NoRecentlyConsumed" xml:space="preserve">
<value>Keine kürzlich konsumierten Elemente.</value>
</data>
<data name="NoMostConsumed" xml:space="preserve">
<value>Keine meistkonsumierten Elemente.</value>
</data>
<data name="LastConsumed" xml:space="preserve">
<value>Zuletzt konsumiert</value>
</data>
<data name="Unavailable" xml:space="preserve">
<value>Dieser Titel ist nicht mehr verfügbar.</value>
<value>Dieses Element ist nicht mehr verfügbar.</value>
</data>
<data name="DeleteFromHistory" xml:space="preserve">
<value>Aus dem Verlauf löschen</value>
</data>
<data name="DeleteFromHistoryConfirm" xml:space="preserve">
<value>Alle aufgezeichneten Sitzungen dieses Elements aus dem Verlauf löschen?</value>
</data>
<data name="HistoryEntryDeleted" xml:space="preserve">
<value>Der Verlaufseintrag wurde gelöscht.</value>
</data>
<data name="ClearHistory" xml:space="preserve">
<value>Verlauf löschen</value>
</data>
<data name="ClearHistoryConfirm" xml:space="preserve">
<value>Den gesamten Konsumverlauf des ausgewählten Benutzers löschen?</value>
</data>
<data name="HistoryCleared" xml:space="preserve">
<value>Der Konsumverlauf wurde gelöscht.</value>
</data>
<data name="ClearResumePoints" xml:space="preserve">
<value>Aus Weiterschauen entfernen</value>
</data>
<data name="ClearResumePointsConfirm" xml:space="preserve">
<value>Alle Fortsetzungspunkte des ausgewählten Benutzers entfernen? Der Verlauf bleibt erhalten.</value>
</data>
<data name="ResumePointsCleared" xml:space="preserve">
<value>Die Fortsetzungspunkte wurden entfernt.</value>
</data>
<data name="Filters" xml:space="preserve">
<value>Filter</value>
</data>
<data name="Library" xml:space="preserve">
<value>Bibliothek</value>
</data>
<data name="AllLibraries" xml:space="preserve">
<value>Alle Bibliotheken</value>
</data>
<data name="AllMediaKinds" xml:space="preserve">
<value>Alle Medienarten</value>
</data>
<data name="From" xml:space="preserve">
<value>Von</value>
</data>
<data name="To" xml:space="preserve">
<value>Bis</value>
</data>
<data name="Apply" xml:space="preserve">
<value>Anwenden</value>
</data>
<data name="Reset" xml:space="preserve">
<value>Zurücksetzen</value>
</data>
<data name="InvalidDateRange" xml:space="preserve">
<value>Das Startdatum darf nicht nach dem Enddatum liegen.</value>
</data>
<data name="User" xml:space="preserve">
<value>Benutzer</value>
</data>
<data name="AllUsers" xml:space="preserve">
<value>Alle Benutzer</value>
</data>
<data name="Me" xml:space="preserve">
<value>Ich</value>
</data>
<data name="AllUsersHistoryUnavailable" xml:space="preserve">
<value>Der Verlauf und die Tag-Aufschlüsselung sind pro Benutzer verfügbar. Wählen Sie einen Benutzer aus, um sie zu sehen.</value>
</data>
<data name="PerUser" xml:space="preserve">
<value>Pro Benutzer</value>
</data>
<data name="NoUsers" xml:space="preserve">
<value>Keine Benutzer haben Konsumstatistiken für diese Filter.</value>
</data>
<data name="NoMediaKindData" xml:space="preserve">
<value>Keine Medienart-Daten für diese Filter.</value>
</data>
<data name="NoConsumption" xml:space="preserve">
<value>Es gibt keinen Konsumverlauf für diese Filter.</value>
</data>
<data name="Loading" xml:space="preserve">
<value>Wird geladen...</value>
</data>
<data name="LoadFailed" xml:space="preserve">
<value>Die Statistik konnte nicht geladen werden.</value>
</data>
<data name="Retry" xml:space="preserve">
<value>Wiederholen</value>
<value>Erneut versuchen</value>
</data>
<data name="Plays" xml:space="preserve">
<value>Wiedergaben</value>
<data name="KindMusicTrack" xml:space="preserve">
<value>Titel</value>
</data>
<data name="Completed" xml:space="preserve">
<value>abgeschlossen</value>
<data name="KindPodcastEpisode" xml:space="preserve">
<value>Podcast-Episode</value>
</data>
<data name="LastPlayed" xml:space="preserve">
<value>Zuletzt gehört</value>
<data name="KindAudiobook" xml:space="preserve">
<value>Hörbuch</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Titel abspielen</value>
<data name="KindMovie" xml:space="preserve">
<value>Film</value>
</data>
<data name="AddToPlaylist" xml:space="preserve">
<value>Zu Wiedergabeliste hinzufügen</value>
<data name="KindTvEpisode" xml:space="preserve">
<value>TV-Episode</value>
</data>
<data name="KindBook" xml:space="preserve">
<value>Buch</value>
</data>
<data name="KindPhoto" xml:space="preserve">
<value>Foto</value>
</data>
<data name="KindVideo" xml:space="preserve">
<value>Video</value>
</data>
<data name="HoursShort" xml:space="preserve">
<value>h</value>
<value>Std.</value>
</data>
<data name="MinutesShort" xml:space="preserve">
<value>m</value>
<value>Min.</value>
</data>
<data name="SecondsShort" xml:space="preserve">
<value>s</value>
<value>Sek.</value>
</data>
</root>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -15,29 +15,149 @@
<data name="Title" xml:space="preserve">
<value>Statistics</value>
</data>
<data name="TotalListeningTime" xml:space="preserve">
<value>Total listening time</value>
<data name="TotalConsumedDuration" xml:space="preserve">
<value>Total consumed time</value>
</data>
<data name="TotalPlays" xml:space="preserve">
<value>Plays</value>
<data name="CountedSessions" xml:space="preserve">
<value>Counted sessions</value>
</data>
<data name="CompletedPlays" xml:space="preserve">
<value>Completed plays</value>
<data name="CompletedSessions" xml:space="preserve">
<value>Completed sessions</value>
</data>
<data name="CompletionRate" xml:space="preserve">
<value>Completion rate</value>
</data>
<data name="RecentlyPlayed" xml:space="preserve">
<value>Recently played</value>
<data name="ByMediaKind" xml:space="preserve">
<value>By media kind</value>
</data>
<data name="MostPlayed" xml:space="preserve">
<value>Most played</value>
<data name="MediaKind" xml:space="preserve">
<value>Media kind</value>
</data>
<data name="NoPlaysYet" xml:space="preserve">
<value>There are no counted plays yet.</value>
<data name="Duration" xml:space="preserve">
<value>Time</value>
</data>
<data name="Stopped" xml:space="preserve">
<value>Stopped</value>
</data>
<data name="Counted" xml:space="preserve">
<value>Counted</value>
</data>
<data name="Completed" xml:space="preserve">
<value>Completed</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Genres</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Tags</value>
</data>
<data name="NoGenres" xml:space="preserve">
<value>No genre data for these filters.</value>
</data>
<data name="NoTags" xml:space="preserve">
<value>No tag data for these filters.</value>
</data>
<data name="Items" xml:space="preserve">
<value>items</value>
</data>
<data name="RecentlyConsumed" xml:space="preserve">
<value>Recently consumed</value>
</data>
<data name="MostConsumed" xml:space="preserve">
<value>Most consumed</value>
</data>
<data name="NoRecentlyConsumed" xml:space="preserve">
<value>No recently consumed items.</value>
</data>
<data name="NoMostConsumed" xml:space="preserve">
<value>No most consumed items.</value>
</data>
<data name="LastConsumed" xml:space="preserve">
<value>Last consumed</value>
</data>
<data name="Unavailable" xml:space="preserve">
<value>This track is no longer available.</value>
<value>This item is no longer available.</value>
</data>
<data name="DeleteFromHistory" xml:space="preserve">
<value>Delete from history</value>
</data>
<data name="DeleteFromHistoryConfirm" xml:space="preserve">
<value>Delete every recorded session of this item from the history?</value>
</data>
<data name="HistoryEntryDeleted" xml:space="preserve">
<value>The history entry was deleted.</value>
</data>
<data name="ClearHistory" xml:space="preserve">
<value>Clear history</value>
</data>
<data name="ClearHistoryConfirm" xml:space="preserve">
<value>Delete the entire consumption history of the selected user?</value>
</data>
<data name="HistoryCleared" xml:space="preserve">
<value>The consumption history was cleared.</value>
</data>
<data name="ClearResumePoints" xml:space="preserve">
<value>Remove from continue watching</value>
</data>
<data name="ClearResumePointsConfirm" xml:space="preserve">
<value>Remove every resume point of the selected user? The history is kept.</value>
</data>
<data name="ResumePointsCleared" xml:space="preserve">
<value>The resume points were removed.</value>
</data>
<data name="Filters" xml:space="preserve">
<value>Filters</value>
</data>
<data name="Library" xml:space="preserve">
<value>Library</value>
</data>
<data name="AllLibraries" xml:space="preserve">
<value>All libraries</value>
</data>
<data name="AllMediaKinds" xml:space="preserve">
<value>All media kinds</value>
</data>
<data name="From" xml:space="preserve">
<value>From</value>
</data>
<data name="To" xml:space="preserve">
<value>To</value>
</data>
<data name="Apply" xml:space="preserve">
<value>Apply</value>
</data>
<data name="Reset" xml:space="preserve">
<value>Reset</value>
</data>
<data name="InvalidDateRange" xml:space="preserve">
<value>The start date must not be after the end date.</value>
</data>
<data name="User" xml:space="preserve">
<value>User</value>
</data>
<data name="AllUsers" xml:space="preserve">
<value>All users</value>
</data>
<data name="Me" xml:space="preserve">
<value>Me</value>
</data>
<data name="AllUsersHistoryUnavailable" xml:space="preserve">
<value>The history and the tag breakdown are available per user. Select a user to see them.</value>
</data>
<data name="PerUser" xml:space="preserve">
<value>Per user</value>
</data>
<data name="NoUsers" xml:space="preserve">
<value>No users have consumption statistics for these filters.</value>
</data>
<data name="NoMediaKindData" xml:space="preserve">
<value>No media kind data for these filters.</value>
</data>
<data name="NoConsumption" xml:space="preserve">
<value>There is no consumption history for these filters.</value>
</data>
<data name="Loading" xml:space="preserve">
<value>Loading...</value>
</data>
<data name="LoadFailed" xml:space="preserve">
<value>The statistics could not be loaded.</value>
@@ -45,20 +165,29 @@
<data name="Retry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="Plays" xml:space="preserve">
<value>plays</value>
<data name="KindMusicTrack" xml:space="preserve">
<value>Track</value>
</data>
<data name="Completed" xml:space="preserve">
<value>completed</value>
<data name="KindPodcastEpisode" xml:space="preserve">
<value>Podcast episode</value>
</data>
<data name="LastPlayed" xml:space="preserve">
<value>Last played</value>
<data name="KindAudiobook" xml:space="preserve">
<value>Audiobook</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Play track</value>
<data name="KindMovie" xml:space="preserve">
<value>Movie</value>
</data>
<data name="AddToPlaylist" xml:space="preserve">
<value>Add to playlist</value>
<data name="KindTvEpisode" xml:space="preserve">
<value>TV episode</value>
</data>
<data name="KindBook" xml:space="preserve">
<value>Book</value>
</data>
<data name="KindPhoto" xml:space="preserve">
<value>Photo</value>
</data>
<data name="KindVideo" xml:space="preserve">
<value>Video</value>
</data>
<data name="HoursShort" xml:space="preserve">
<value>h</value>
@@ -69,4 +198,4 @@
<data name="SecondsShort" xml:space="preserve">
<value>s</value>
</data>
</root>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -15,29 +15,149 @@
<data name="Title" xml:space="preserve">
<value>Estadísticas</value>
</data>
<data name="TotalListeningTime" xml:space="preserve">
<value>Tiempo total de escucha</value>
<data name="TotalConsumedDuration" xml:space="preserve">
<value>Tiempo total consumido</value>
</data>
<data name="TotalPlays" xml:space="preserve">
<value>Reproducciones</value>
<data name="CountedSessions" xml:space="preserve">
<value>Sesiones contabilizadas</value>
</data>
<data name="CompletedPlays" xml:space="preserve">
<value>Reproducciones completadas</value>
<data name="CompletedSessions" xml:space="preserve">
<value>Sesiones completadas</value>
</data>
<data name="CompletionRate" xml:space="preserve">
<value>Tasa de finalización</value>
</data>
<data name="RecentlyPlayed" xml:space="preserve">
<value>Reproducido recientemente</value>
<data name="ByMediaKind" xml:space="preserve">
<value>Por tipo de medio</value>
</data>
<data name="MostPlayed" xml:space="preserve">
<value>Más reproducido</value>
<data name="MediaKind" xml:space="preserve">
<value>Tipo de medio</value>
</data>
<data name="NoPlaysYet" xml:space="preserve">
<value>Aún no hay reproducciones contabilizadas.</value>
<data name="Duration" xml:space="preserve">
<value>Tiempo</value>
</data>
<data name="Stopped" xml:space="preserve">
<value>Detenidas</value>
</data>
<data name="Counted" xml:space="preserve">
<value>Contabilizadas</value>
</data>
<data name="Completed" xml:space="preserve">
<value>Completadas</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Géneros</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Etiquetas</value>
</data>
<data name="NoGenres" xml:space="preserve">
<value>No hay datos de géneros para estos filtros.</value>
</data>
<data name="NoTags" xml:space="preserve">
<value>No hay datos de etiquetas para estos filtros.</value>
</data>
<data name="Items" xml:space="preserve">
<value>elementos</value>
</data>
<data name="RecentlyConsumed" xml:space="preserve">
<value>Consumido recientemente</value>
</data>
<data name="MostConsumed" xml:space="preserve">
<value>Más consumido</value>
</data>
<data name="NoRecentlyConsumed" xml:space="preserve">
<value>No hay elementos consumidos recientemente.</value>
</data>
<data name="NoMostConsumed" xml:space="preserve">
<value>No hay elementos más consumidos.</value>
</data>
<data name="LastConsumed" xml:space="preserve">
<value>Último consumo</value>
</data>
<data name="Unavailable" xml:space="preserve">
<value>Esta pista ya no está disponible.</value>
<value>Este elemento ya no está disponible.</value>
</data>
<data name="DeleteFromHistory" xml:space="preserve">
<value>Eliminar del historial</value>
</data>
<data name="DeleteFromHistoryConfirm" xml:space="preserve">
<value>¿Eliminar todas las sesiones registradas de este elemento del historial?</value>
</data>
<data name="HistoryEntryDeleted" xml:space="preserve">
<value>La entrada del historial fue eliminada.</value>
</data>
<data name="ClearHistory" xml:space="preserve">
<value>Borrar historial</value>
</data>
<data name="ClearHistoryConfirm" xml:space="preserve">
<value>¿Borrar todo el historial de consumo del usuario seleccionado?</value>
</data>
<data name="HistoryCleared" xml:space="preserve">
<value>El historial de consumo fue borrado.</value>
</data>
<data name="ClearResumePoints" xml:space="preserve">
<value>Quitar de continuar viendo</value>
</data>
<data name="ClearResumePointsConfirm" xml:space="preserve">
<value>¿Quitar todos los puntos de reanudación del usuario seleccionado? El historial se conserva.</value>
</data>
<data name="ResumePointsCleared" xml:space="preserve">
<value>Los puntos de reanudación fueron eliminados.</value>
</data>
<data name="Filters" xml:space="preserve">
<value>Filtros</value>
</data>
<data name="Library" xml:space="preserve">
<value>Biblioteca</value>
</data>
<data name="AllLibraries" xml:space="preserve">
<value>Todas las bibliotecas</value>
</data>
<data name="AllMediaKinds" xml:space="preserve">
<value>Todos los tipos de medio</value>
</data>
<data name="From" xml:space="preserve">
<value>Desde</value>
</data>
<data name="To" xml:space="preserve">
<value>Hasta</value>
</data>
<data name="Apply" xml:space="preserve">
<value>Aplicar</value>
</data>
<data name="Reset" xml:space="preserve">
<value>Restablecer</value>
</data>
<data name="InvalidDateRange" xml:space="preserve">
<value>La fecha de inicio no debe ser posterior a la fecha de fin.</value>
</data>
<data name="User" xml:space="preserve">
<value>Usuario</value>
</data>
<data name="AllUsers" xml:space="preserve">
<value>Todos los usuarios</value>
</data>
<data name="Me" xml:space="preserve">
<value>Yo</value>
</data>
<data name="AllUsersHistoryUnavailable" xml:space="preserve">
<value>El historial y el desglose de etiquetas están disponibles por usuario. Seleccione un usuario para verlos.</value>
</data>
<data name="PerUser" xml:space="preserve">
<value>Por usuario</value>
</data>
<data name="NoUsers" xml:space="preserve">
<value>Ningún usuario tiene estadísticas de consumo para estos filtros.</value>
</data>
<data name="NoMediaKindData" xml:space="preserve">
<value>No hay datos de tipo de medio para estos filtros.</value>
</data>
<data name="NoConsumption" xml:space="preserve">
<value>No hay historial de consumo para estos filtros.</value>
</data>
<data name="Loading" xml:space="preserve">
<value>Cargando...</value>
</data>
<data name="LoadFailed" xml:space="preserve">
<value>No se pudieron cargar las estadísticas.</value>
@@ -45,20 +165,29 @@
<data name="Retry" xml:space="preserve">
<value>Reintentar</value>
</data>
<data name="Plays" xml:space="preserve">
<value>reproducciones</value>
<data name="KindMusicTrack" xml:space="preserve">
<value>Pista</value>
</data>
<data name="Completed" xml:space="preserve">
<value>completadas</value>
<data name="KindPodcastEpisode" xml:space="preserve">
<value>Episodio de podcast</value>
</data>
<data name="LastPlayed" xml:space="preserve">
<value>Última reproducción</value>
<data name="KindAudiobook" xml:space="preserve">
<value>Audiolibro</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Reproducir pista</value>
<data name="KindMovie" xml:space="preserve">
<value>Película</value>
</data>
<data name="AddToPlaylist" xml:space="preserve">
<value>Añadir a la lista de reproducción</value>
<data name="KindTvEpisode" xml:space="preserve">
<value>Episodio de TV</value>
</data>
<data name="KindBook" xml:space="preserve">
<value>Libro</value>
</data>
<data name="KindPhoto" xml:space="preserve">
<value>Foto</value>
</data>
<data name="KindVideo" xml:space="preserve">
<value>Vídeo</value>
</data>
<data name="HoursShort" xml:space="preserve">
<value>h</value>
@@ -69,4 +198,4 @@
<data name="SecondsShort" xml:space="preserve">
<value>s</value>
</data>
</root>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -15,29 +15,149 @@
<data name="Title" xml:space="preserve">
<value>Statistiques</value>
</data>
<data name="TotalListeningTime" xml:space="preserve">
<value>Temps d'écoute total</value>
<data name="TotalConsumedDuration" xml:space="preserve">
<value>Temps total consommé</value>
</data>
<data name="TotalPlays" xml:space="preserve">
<value>Écoutes</value>
<data name="CountedSessions" xml:space="preserve">
<value>Sessions comptabilisées</value>
</data>
<data name="CompletedPlays" xml:space="preserve">
<value>Écoutes terminées</value>
<data name="CompletedSessions" xml:space="preserve">
<value>Sessions terminées</value>
</data>
<data name="CompletionRate" xml:space="preserve">
<value>Taux d'achèvement</value>
</data>
<data name="RecentlyPlayed" xml:space="preserve">
<value>Écoutés récemment</value>
<data name="ByMediaKind" xml:space="preserve">
<value>Par type de média</value>
</data>
<data name="MostPlayed" xml:space="preserve">
<value>Les plus écoutés</value>
<data name="MediaKind" xml:space="preserve">
<value>Type de média</value>
</data>
<data name="NoPlaysYet" xml:space="preserve">
<value>Aucune écoute comptabilisée pour le moment.</value>
<data name="Duration" xml:space="preserve">
<value>Temps</value>
</data>
<data name="Stopped" xml:space="preserve">
<value>Arrêtées</value>
</data>
<data name="Counted" xml:space="preserve">
<value>Comptabilisées</value>
</data>
<data name="Completed" xml:space="preserve">
<value>Terminées</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Genres</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Étiquettes</value>
</data>
<data name="NoGenres" xml:space="preserve">
<value>Aucune donnée de genre pour ces filtres.</value>
</data>
<data name="NoTags" xml:space="preserve">
<value>Aucune donnée d'étiquette pour ces filtres.</value>
</data>
<data name="Items" xml:space="preserve">
<value>éléments</value>
</data>
<data name="RecentlyConsumed" xml:space="preserve">
<value>Consommé récemment</value>
</data>
<data name="MostConsumed" xml:space="preserve">
<value>Le plus consommé</value>
</data>
<data name="NoRecentlyConsumed" xml:space="preserve">
<value>Aucun élément consommé récemment.</value>
</data>
<data name="NoMostConsumed" xml:space="preserve">
<value>Aucun élément le plus consommé.</value>
</data>
<data name="LastConsumed" xml:space="preserve">
<value>Dernière consommation</value>
</data>
<data name="Unavailable" xml:space="preserve">
<value>Ce morceau n'est plus disponible.</value>
<value>Cet élément n'est plus disponible.</value>
</data>
<data name="DeleteFromHistory" xml:space="preserve">
<value>Supprimer de l'historique</value>
</data>
<data name="DeleteFromHistoryConfirm" xml:space="preserve">
<value>Supprimer toutes les sessions enregistrées de cet élément de l'historique ?</value>
</data>
<data name="HistoryEntryDeleted" xml:space="preserve">
<value>L'entrée de l'historique a été supprimée.</value>
</data>
<data name="ClearHistory" xml:space="preserve">
<value>Effacer l'historique</value>
</data>
<data name="ClearHistoryConfirm" xml:space="preserve">
<value>Effacer tout l'historique de consommation de l'utilisateur sélectionné ?</value>
</data>
<data name="HistoryCleared" xml:space="preserve">
<value>L'historique de consommation a été effacé.</value>
</data>
<data name="ClearResumePoints" xml:space="preserve">
<value>Retirer de la reprise</value>
</data>
<data name="ClearResumePointsConfirm" xml:space="preserve">
<value>Retirer tous les points de reprise de l'utilisateur sélectionné ? L'historique est conservé.</value>
</data>
<data name="ResumePointsCleared" xml:space="preserve">
<value>Les points de reprise ont été retirés.</value>
</data>
<data name="Filters" xml:space="preserve">
<value>Filtres</value>
</data>
<data name="Library" xml:space="preserve">
<value>Bibliothèque</value>
</data>
<data name="AllLibraries" xml:space="preserve">
<value>Toutes les bibliothèques</value>
</data>
<data name="AllMediaKinds" xml:space="preserve">
<value>Tous les types de média</value>
</data>
<data name="From" xml:space="preserve">
<value>Du</value>
</data>
<data name="To" xml:space="preserve">
<value>Au</value>
</data>
<data name="Apply" xml:space="preserve">
<value>Appliquer</value>
</data>
<data name="Reset" xml:space="preserve">
<value>Réinitialiser</value>
</data>
<data name="InvalidDateRange" xml:space="preserve">
<value>La date de début ne doit pas être postérieure à la date de fin.</value>
</data>
<data name="User" xml:space="preserve">
<value>Utilisateur</value>
</data>
<data name="AllUsers" xml:space="preserve">
<value>Tous les utilisateurs</value>
</data>
<data name="Me" xml:space="preserve">
<value>Moi</value>
</data>
<data name="AllUsersHistoryUnavailable" xml:space="preserve">
<value>L'historique et la répartition des étiquettes sont disponibles par utilisateur. Sélectionnez un utilisateur pour les voir.</value>
</data>
<data name="PerUser" xml:space="preserve">
<value>Par utilisateur</value>
</data>
<data name="NoUsers" xml:space="preserve">
<value>Aucun utilisateur n'a de statistiques de consommation pour ces filtres.</value>
</data>
<data name="NoMediaKindData" xml:space="preserve">
<value>Aucune donnée de type de média pour ces filtres.</value>
</data>
<data name="NoConsumption" xml:space="preserve">
<value>Aucun historique de consommation pour ces filtres.</value>
</data>
<data name="Loading" xml:space="preserve">
<value>Chargement...</value>
</data>
<data name="LoadFailed" xml:space="preserve">
<value>Les statistiques n'ont pas pu être chargées.</value>
@@ -45,20 +165,29 @@
<data name="Retry" xml:space="preserve">
<value>Réessayer</value>
</data>
<data name="Plays" xml:space="preserve">
<value>écoutes</value>
<data name="KindMusicTrack" xml:space="preserve">
<value>Piste</value>
</data>
<data name="Completed" xml:space="preserve">
<value>terminées</value>
<data name="KindPodcastEpisode" xml:space="preserve">
<value>Épisode de podcast</value>
</data>
<data name="LastPlayed" xml:space="preserve">
<value>Dernière écoute</value>
<data name="KindAudiobook" xml:space="preserve">
<value>Livre audio</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Lire le morceau</value>
<data name="KindMovie" xml:space="preserve">
<value>Film</value>
</data>
<data name="AddToPlaylist" xml:space="preserve">
<value>Ajouter à la playlist</value>
<data name="KindTvEpisode" xml:space="preserve">
<value>Épisode TV</value>
</data>
<data name="KindBook" xml:space="preserve">
<value>Livre</value>
</data>
<data name="KindPhoto" xml:space="preserve">
<value>Photo</value>
</data>
<data name="KindVideo" xml:space="preserve">
<value>Vidéo</value>
</data>
<data name="HoursShort" xml:space="preserve">
<value>h</value>
@@ -69,4 +198,4 @@
<data name="SecondsShort" xml:space="preserve">
<value>s</value>
</data>
</root>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -15,29 +15,149 @@
<data name="Title" xml:space="preserve">
<value>Statistiche</value>
</data>
<data name="TotalListeningTime" xml:space="preserve">
<value>Tempo di ascolto totale</value>
<data name="TotalConsumedDuration" xml:space="preserve">
<value>Tempo totale consumato</value>
</data>
<data name="TotalPlays" xml:space="preserve">
<value>Riproduzioni</value>
<data name="CountedSessions" xml:space="preserve">
<value>Sessioni conteggiate</value>
</data>
<data name="CompletedPlays" xml:space="preserve">
<value>Riproduzioni completate</value>
<data name="CompletedSessions" xml:space="preserve">
<value>Sessioni completate</value>
</data>
<data name="CompletionRate" xml:space="preserve">
<value>Tasso di completamento</value>
</data>
<data name="RecentlyPlayed" xml:space="preserve">
<value>Riprodotti di recente</value>
<data name="ByMediaKind" xml:space="preserve">
<value>Per tipo di contenuto</value>
</data>
<data name="MostPlayed" xml:space="preserve">
<value>Più riprodotti</value>
<data name="MediaKind" xml:space="preserve">
<value>Tipo di contenuto</value>
</data>
<data name="NoPlaysYet" xml:space="preserve">
<value>Non ci sono ancora riproduzioni conteggiate.</value>
<data name="Duration" xml:space="preserve">
<value>Tempo</value>
</data>
<data name="Stopped" xml:space="preserve">
<value>Interrotte</value>
</data>
<data name="Counted" xml:space="preserve">
<value>Conteggiate</value>
</data>
<data name="Completed" xml:space="preserve">
<value>Completate</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Generi</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Tag</value>
</data>
<data name="NoGenres" xml:space="preserve">
<value>Nessun dato sui generi per questi filtri.</value>
</data>
<data name="NoTags" xml:space="preserve">
<value>Nessun dato sui tag per questi filtri.</value>
</data>
<data name="Items" xml:space="preserve">
<value>elementi</value>
</data>
<data name="RecentlyConsumed" xml:space="preserve">
<value>Consumati di recente</value>
</data>
<data name="MostConsumed" xml:space="preserve">
<value>Più consumati</value>
</data>
<data name="NoRecentlyConsumed" xml:space="preserve">
<value>Nessun elemento consumato di recente.</value>
</data>
<data name="NoMostConsumed" xml:space="preserve">
<value>Nessun elemento più consumato.</value>
</data>
<data name="LastConsumed" xml:space="preserve">
<value>Ultimo consumo</value>
</data>
<data name="Unavailable" xml:space="preserve">
<value>Questo brano non è più disponibile.</value>
<value>Questo elemento non è più disponibile.</value>
</data>
<data name="DeleteFromHistory" xml:space="preserve">
<value>Elimina dalla cronologia</value>
</data>
<data name="DeleteFromHistoryConfirm" xml:space="preserve">
<value>Eliminare dalla cronologia tutte le sessioni registrate di questo elemento?</value>
</data>
<data name="HistoryEntryDeleted" xml:space="preserve">
<value>La voce della cronologia è stata eliminata.</value>
</data>
<data name="ClearHistory" xml:space="preserve">
<value>Cancella cronologia</value>
</data>
<data name="ClearHistoryConfirm" xml:space="preserve">
<value>Cancellare l'intera cronologia di consumo dell'utente selezionato?</value>
</data>
<data name="HistoryCleared" xml:space="preserve">
<value>La cronologia di consumo è stata cancellata.</value>
</data>
<data name="ClearResumePoints" xml:space="preserve">
<value>Rimuovi da continua a guardare</value>
</data>
<data name="ClearResumePointsConfirm" xml:space="preserve">
<value>Rimuovere tutti i punti di ripresa dell'utente selezionato? La cronologia viene mantenuta.</value>
</data>
<data name="ResumePointsCleared" xml:space="preserve">
<value>I punti di ripresa sono stati rimossi.</value>
</data>
<data name="Filters" xml:space="preserve">
<value>Filtri</value>
</data>
<data name="Library" xml:space="preserve">
<value>Libreria</value>
</data>
<data name="AllLibraries" xml:space="preserve">
<value>Tutte le librerie</value>
</data>
<data name="AllMediaKinds" xml:space="preserve">
<value>Tutti i tipi di contenuto</value>
</data>
<data name="From" xml:space="preserve">
<value>Da</value>
</data>
<data name="To" xml:space="preserve">
<value>A</value>
</data>
<data name="Apply" xml:space="preserve">
<value>Applica</value>
</data>
<data name="Reset" xml:space="preserve">
<value>Reimposta</value>
</data>
<data name="InvalidDateRange" xml:space="preserve">
<value>La data di inizio non deve essere successiva alla data di fine.</value>
</data>
<data name="User" xml:space="preserve">
<value>Utente</value>
</data>
<data name="AllUsers" xml:space="preserve">
<value>Tutti gli utenti</value>
</data>
<data name="Me" xml:space="preserve">
<value>Io</value>
</data>
<data name="AllUsersHistoryUnavailable" xml:space="preserve">
<value>La cronologia e la suddivisione dei tag sono disponibili per utente. Seleziona un utente per visualizzarle.</value>
</data>
<data name="PerUser" xml:space="preserve">
<value>Per utente</value>
</data>
<data name="NoUsers" xml:space="preserve">
<value>Nessun utente ha statistiche di consumo per questi filtri.</value>
</data>
<data name="NoMediaKindData" xml:space="preserve">
<value>Nessun dato sul tipo di contenuto per questi filtri.</value>
</data>
<data name="NoConsumption" xml:space="preserve">
<value>Nessuna cronologia di consumo per questi filtri.</value>
</data>
<data name="Loading" xml:space="preserve">
<value>Caricamento...</value>
</data>
<data name="LoadFailed" xml:space="preserve">
<value>Impossibile caricare le statistiche.</value>
@@ -45,20 +165,29 @@
<data name="Retry" xml:space="preserve">
<value>Riprova</value>
</data>
<data name="Plays" xml:space="preserve">
<value>riproduzioni</value>
<data name="KindMusicTrack" xml:space="preserve">
<value>Brano</value>
</data>
<data name="Completed" xml:space="preserve">
<value>completate</value>
<data name="KindPodcastEpisode" xml:space="preserve">
<value>Episodio di podcast</value>
</data>
<data name="LastPlayed" xml:space="preserve">
<value>Ultima riproduzione</value>
<data name="KindAudiobook" xml:space="preserve">
<value>Audiolibro</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Riproduci brano</value>
<data name="KindMovie" xml:space="preserve">
<value>Film</value>
</data>
<data name="AddToPlaylist" xml:space="preserve">
<value>Aggiungi alla playlist</value>
<data name="KindTvEpisode" xml:space="preserve">
<value>Episodio TV</value>
</data>
<data name="KindBook" xml:space="preserve">
<value>Libro</value>
</data>
<data name="KindPhoto" xml:space="preserve">
<value>Foto</value>
</data>
<data name="KindVideo" xml:space="preserve">
<value>Video</value>
</data>
<data name="HoursShort" xml:space="preserve">
<value>h</value>
@@ -69,4 +198,4 @@
<data name="SecondsShort" xml:space="preserve">
<value>s</value>
</data>
</root>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -15,29 +15,149 @@
<data name="Title" xml:space="preserve">
<value>統計</value>
</data>
<data name="TotalListeningTime" xml:space="preserve">
<value>合計再生時間</value>
<data name="TotalConsumedDuration" xml:space="preserve">
<value>総消費時間</value>
</data>
<data name="TotalPlays" xml:space="preserve">
<value>再生回数</value>
<data name="CountedSessions" xml:space="preserve">
<value>集計対象セッション</value>
</data>
<data name="CompletedPlays" xml:space="preserve">
<value>最後まで再生した回数</value>
<data name="CompletedSessions" xml:space="preserve">
<value>完了セッション</value>
</data>
<data name="CompletionRate" xml:space="preserve">
<value>完了率</value>
</data>
<data name="RecentlyPlayed" xml:space="preserve">
<value>最近再生した曲</value>
<data name="ByMediaKind" xml:space="preserve">
<value>メディア種別ごと</value>
</data>
<data name="MostPlayed" xml:space="preserve">
<value>よく再生する曲</value>
<data name="MediaKind" xml:space="preserve">
<value>メディア種別</value>
</data>
<data name="NoPlaysYet" xml:space="preserve">
<value>集計対象の再生はまだありません。</value>
<data name="Duration" xml:space="preserve">
<value>時間</value>
</data>
<data name="Stopped" xml:space="preserve">
<value>停止</value>
</data>
<data name="Counted" xml:space="preserve">
<value>集計対象</value>
</data>
<data name="Completed" xml:space="preserve">
<value>完了</value>
</data>
<data name="Genres" xml:space="preserve">
<value>ジャンル</value>
</data>
<data name="Tags" xml:space="preserve">
<value>タグ</value>
</data>
<data name="NoGenres" xml:space="preserve">
<value>このフィルターのジャンルデータはありません。</value>
</data>
<data name="NoTags" xml:space="preserve">
<value>このフィルターのタグデータはありません。</value>
</data>
<data name="Items" xml:space="preserve">
<value>件</value>
</data>
<data name="RecentlyConsumed" xml:space="preserve">
<value>最近消費したもの</value>
</data>
<data name="MostConsumed" xml:space="preserve">
<value>最も消費したもの</value>
</data>
<data name="NoRecentlyConsumed" xml:space="preserve">
<value>最近消費したものはありません。</value>
</data>
<data name="NoMostConsumed" xml:space="preserve">
<value>最も消費したものはありません。</value>
</data>
<data name="LastConsumed" xml:space="preserve">
<value>最終消費</value>
</data>
<data name="Unavailable" xml:space="preserve">
<value>この曲はもう利用できません。</value>
<value>このアイテムはもう利用できません。</value>
</data>
<data name="DeleteFromHistory" xml:space="preserve">
<value>履歴から削除</value>
</data>
<data name="DeleteFromHistoryConfirm" xml:space="preserve">
<value>このアイテムの記録されたすべてのセッションを履歴から削除しますか?</value>
</data>
<data name="HistoryEntryDeleted" xml:space="preserve">
<value>履歴の項目を削除しました。</value>
</data>
<data name="ClearHistory" xml:space="preserve">
<value>履歴を消去</value>
</data>
<data name="ClearHistoryConfirm" xml:space="preserve">
<value>選択したユーザーの消費履歴をすべて削除しますか?</value>
</data>
<data name="HistoryCleared" xml:space="preserve">
<value>消費履歴を消去しました。</value>
</data>
<data name="ClearResumePoints" xml:space="preserve">
<value>続きを見るから削除</value>
</data>
<data name="ClearResumePointsConfirm" xml:space="preserve">
<value>選択したユーザーの再開ポイントをすべて削除しますか? 履歴は保持されます。</value>
</data>
<data name="ResumePointsCleared" xml:space="preserve">
<value>再開ポイントを削除しました。</value>
</data>
<data name="Filters" xml:space="preserve">
<value>フィルター</value>
</data>
<data name="Library" xml:space="preserve">
<value>ライブラリ</value>
</data>
<data name="AllLibraries" xml:space="preserve">
<value>すべてのライブラリ</value>
</data>
<data name="AllMediaKinds" xml:space="preserve">
<value>すべてのメディア種別</value>
</data>
<data name="From" xml:space="preserve">
<value>開始</value>
</data>
<data name="To" xml:space="preserve">
<value>終了</value>
</data>
<data name="Apply" xml:space="preserve">
<value>適用</value>
</data>
<data name="Reset" xml:space="preserve">
<value>リセット</value>
</data>
<data name="InvalidDateRange" xml:space="preserve">
<value>開始日は終了日より後にできません。</value>
</data>
<data name="User" xml:space="preserve">
<value>ユーザー</value>
</data>
<data name="AllUsers" xml:space="preserve">
<value>すべてのユーザー</value>
</data>
<data name="Me" xml:space="preserve">
<value>自分</value>
</data>
<data name="AllUsersHistoryUnavailable" xml:space="preserve">
<value>履歴とタグの内訳はユーザーごとに表示されます。表示するユーザーを選択してください。</value>
</data>
<data name="PerUser" xml:space="preserve">
<value>ユーザーごと</value>
</data>
<data name="NoUsers" xml:space="preserve">
<value>このフィルターの消費統計を持つユーザーはいません。</value>
</data>
<data name="NoMediaKindData" xml:space="preserve">
<value>このフィルターのメディア種別データはありません。</value>
</data>
<data name="NoConsumption" xml:space="preserve">
<value>このフィルターの消費履歴はありません。</value>
</data>
<data name="Loading" xml:space="preserve">
<value>読み込み中...</value>
</data>
<data name="LoadFailed" xml:space="preserve">
<value>統計を読み込めませんでした。</value>
@@ -45,20 +165,29 @@
<data name="Retry" xml:space="preserve">
<value>再試行</value>
</data>
<data name="Plays" xml:space="preserve">
<value>回</value>
<data name="KindMusicTrack" xml:space="preserve">
<value>トラック</value>
</data>
<data name="Completed" xml:space="preserve">
<value>回完了</value>
<data name="KindPodcastEpisode" xml:space="preserve">
<value>ポッドキャストエピソード</value>
</data>
<data name="LastPlayed" xml:space="preserve">
<value>最終再生</value>
<data name="KindAudiobook" xml:space="preserve">
<value>オーディオブック</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>曲を再生</value>
<data name="KindMovie" xml:space="preserve">
<value>映画</value>
</data>
<data name="AddToPlaylist" xml:space="preserve">
<value>プレイリストに追加</value>
<data name="KindTvEpisode" xml:space="preserve">
<value>TVエピソード</value>
</data>
<data name="KindBook" xml:space="preserve">
<value>本</value>
</data>
<data name="KindPhoto" xml:space="preserve">
<value>写真</value>
</data>
<data name="KindVideo" xml:space="preserve">
<value>動画</value>
</data>
<data name="HoursShort" xml:space="preserve">
<value>時間</value>
@@ -69,4 +198,4 @@
<data name="SecondsShort" xml:space="preserve">
<value>秒</value>
</data>
</root>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -15,29 +15,149 @@
<data name="Title" xml:space="preserve">
<value>Statistics</value>
</data>
<data name="TotalListeningTime" xml:space="preserve">
<value>Total listening time</value>
<data name="TotalConsumedDuration" xml:space="preserve">
<value>Total consumed time</value>
</data>
<data name="TotalPlays" xml:space="preserve">
<value>Plays</value>
<data name="CountedSessions" xml:space="preserve">
<value>Counted sessions</value>
</data>
<data name="CompletedPlays" xml:space="preserve">
<value>Completed plays</value>
<data name="CompletedSessions" xml:space="preserve">
<value>Completed sessions</value>
</data>
<data name="CompletionRate" xml:space="preserve">
<value>Completion rate</value>
</data>
<data name="RecentlyPlayed" xml:space="preserve">
<value>Recently played</value>
<data name="ByMediaKind" xml:space="preserve">
<value>By media kind</value>
</data>
<data name="MostPlayed" xml:space="preserve">
<value>Most played</value>
<data name="MediaKind" xml:space="preserve">
<value>Media kind</value>
</data>
<data name="NoPlaysYet" xml:space="preserve">
<value>There are no counted plays yet.</value>
<data name="Duration" xml:space="preserve">
<value>Time</value>
</data>
<data name="Stopped" xml:space="preserve">
<value>Stopped</value>
</data>
<data name="Counted" xml:space="preserve">
<value>Counted</value>
</data>
<data name="Completed" xml:space="preserve">
<value>Completed</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Genres</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Tags</value>
</data>
<data name="NoGenres" xml:space="preserve">
<value>No genre data for these filters.</value>
</data>
<data name="NoTags" xml:space="preserve">
<value>No tag data for these filters.</value>
</data>
<data name="Items" xml:space="preserve">
<value>items</value>
</data>
<data name="RecentlyConsumed" xml:space="preserve">
<value>Recently consumed</value>
</data>
<data name="MostConsumed" xml:space="preserve">
<value>Most consumed</value>
</data>
<data name="NoRecentlyConsumed" xml:space="preserve">
<value>No recently consumed items.</value>
</data>
<data name="NoMostConsumed" xml:space="preserve">
<value>No most consumed items.</value>
</data>
<data name="LastConsumed" xml:space="preserve">
<value>Last consumed</value>
</data>
<data name="Unavailable" xml:space="preserve">
<value>This track is no longer available.</value>
<value>This item is no longer available.</value>
</data>
<data name="DeleteFromHistory" xml:space="preserve">
<value>Delete from history</value>
</data>
<data name="DeleteFromHistoryConfirm" xml:space="preserve">
<value>Delete every recorded session of this item from the history?</value>
</data>
<data name="HistoryEntryDeleted" xml:space="preserve">
<value>The history entry was deleted.</value>
</data>
<data name="ClearHistory" xml:space="preserve">
<value>Clear history</value>
</data>
<data name="ClearHistoryConfirm" xml:space="preserve">
<value>Delete the entire consumption history of the selected user?</value>
</data>
<data name="HistoryCleared" xml:space="preserve">
<value>The consumption history was cleared.</value>
</data>
<data name="ClearResumePoints" xml:space="preserve">
<value>Remove from continue watching</value>
</data>
<data name="ClearResumePointsConfirm" xml:space="preserve">
<value>Remove every resume point of the selected user? The history is kept.</value>
</data>
<data name="ResumePointsCleared" xml:space="preserve">
<value>The resume points were removed.</value>
</data>
<data name="Filters" xml:space="preserve">
<value>Filters</value>
</data>
<data name="Library" xml:space="preserve">
<value>Library</value>
</data>
<data name="AllLibraries" xml:space="preserve">
<value>All libraries</value>
</data>
<data name="AllMediaKinds" xml:space="preserve">
<value>All media kinds</value>
</data>
<data name="From" xml:space="preserve">
<value>From</value>
</data>
<data name="To" xml:space="preserve">
<value>To</value>
</data>
<data name="Apply" xml:space="preserve">
<value>Apply</value>
</data>
<data name="Reset" xml:space="preserve">
<value>Reset</value>
</data>
<data name="InvalidDateRange" xml:space="preserve">
<value>The start date must not be after the end date.</value>
</data>
<data name="User" xml:space="preserve">
<value>User</value>
</data>
<data name="AllUsers" xml:space="preserve">
<value>All users</value>
</data>
<data name="Me" xml:space="preserve">
<value>Me</value>
</data>
<data name="AllUsersHistoryUnavailable" xml:space="preserve">
<value>The history and the tag breakdown are available per user. Select a user to see them.</value>
</data>
<data name="PerUser" xml:space="preserve">
<value>Per user</value>
</data>
<data name="NoUsers" xml:space="preserve">
<value>No users have consumption statistics for these filters.</value>
</data>
<data name="NoMediaKindData" xml:space="preserve">
<value>No media kind data for these filters.</value>
</data>
<data name="NoConsumption" xml:space="preserve">
<value>There is no consumption history for these filters.</value>
</data>
<data name="Loading" xml:space="preserve">
<value>Loading...</value>
</data>
<data name="LoadFailed" xml:space="preserve">
<value>The statistics could not be loaded.</value>
@@ -45,20 +165,29 @@
<data name="Retry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="Plays" xml:space="preserve">
<value>plays</value>
<data name="KindMusicTrack" xml:space="preserve">
<value>Track</value>
</data>
<data name="Completed" xml:space="preserve">
<value>completed</value>
<data name="KindPodcastEpisode" xml:space="preserve">
<value>Podcast episode</value>
</data>
<data name="LastPlayed" xml:space="preserve">
<value>Last played</value>
<data name="KindAudiobook" xml:space="preserve">
<value>Audiobook</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Play track</value>
<data name="KindMovie" xml:space="preserve">
<value>Movie</value>
</data>
<data name="AddToPlaylist" xml:space="preserve">
<value>Add to playlist</value>
<data name="KindTvEpisode" xml:space="preserve">
<value>TV episode</value>
</data>
<data name="KindBook" xml:space="preserve">
<value>Book</value>
</data>
<data name="KindPhoto" xml:space="preserve">
<value>Photo</value>
</data>
<data name="KindVideo" xml:space="preserve">
<value>Video</value>
</data>
<data name="HoursShort" xml:space="preserve">
<value>h</value>
@@ -69,4 +198,4 @@
<data name="SecondsShort" xml:space="preserve">
<value>s</value>
</data>
</root>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -15,29 +15,149 @@
<data name="Title" xml:space="preserve">
<value>Statistici</value>
</data>
<data name="TotalListeningTime" xml:space="preserve">
<value>Timp total de ascultare</value>
<data name="TotalConsumedDuration" xml:space="preserve">
<value>Timp total consumat</value>
</data>
<data name="TotalPlays" xml:space="preserve">
<value>Redări</value>
<data name="CountedSessions" xml:space="preserve">
<value>Sesiuni contorizate</value>
</data>
<data name="CompletedPlays" xml:space="preserve">
<value>Redări finalizate</value>
<data name="CompletedSessions" xml:space="preserve">
<value>Sesiuni finalizate</value>
</data>
<data name="CompletionRate" xml:space="preserve">
<value>Rată de finalizare</value>
</data>
<data name="RecentlyPlayed" xml:space="preserve">
<value>Ascultate recent</value>
<data name="ByMediaKind" xml:space="preserve">
<value>După tipul de conținut</value>
</data>
<data name="MostPlayed" xml:space="preserve">
<value>Cele mai ascultate</value>
<data name="MediaKind" xml:space="preserve">
<value>Tip de conținut</value>
</data>
<data name="NoPlaysYet" xml:space="preserve">
<value>Nu există încă redări contorizate.</value>
<data name="Duration" xml:space="preserve">
<value>Timp</value>
</data>
<data name="Stopped" xml:space="preserve">
<value>Oprite</value>
</data>
<data name="Counted" xml:space="preserve">
<value>Contorizate</value>
</data>
<data name="Completed" xml:space="preserve">
<value>Finalizate</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Genuri</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Etichete</value>
</data>
<data name="NoGenres" xml:space="preserve">
<value>Nu există date despre genuri pentru aceste filtre.</value>
</data>
<data name="NoTags" xml:space="preserve">
<value>Nu există date despre etichete pentru aceste filtre.</value>
</data>
<data name="Items" xml:space="preserve">
<value>elemente</value>
</data>
<data name="RecentlyConsumed" xml:space="preserve">
<value>Consumate recent</value>
</data>
<data name="MostConsumed" xml:space="preserve">
<value>Cele mai consumate</value>
</data>
<data name="NoRecentlyConsumed" xml:space="preserve">
<value>Nu există elemente consumate recent.</value>
</data>
<data name="NoMostConsumed" xml:space="preserve">
<value>Nu există elemente cele mai consumate.</value>
</data>
<data name="LastConsumed" xml:space="preserve">
<value>Ultima consumare</value>
</data>
<data name="Unavailable" xml:space="preserve">
<value>Această piesă nu mai este disponibilă.</value>
<value>Acest element nu mai este disponibil.</value>
</data>
<data name="DeleteFromHistory" xml:space="preserve">
<value>Șterge din istoric</value>
</data>
<data name="DeleteFromHistoryConfirm" xml:space="preserve">
<value>Ștergi toate sesiunile înregistrate ale acestui element din istoric?</value>
</data>
<data name="HistoryEntryDeleted" xml:space="preserve">
<value>Intrarea din istoric a fost ștearsă.</value>
</data>
<data name="ClearHistory" xml:space="preserve">
<value>Golește istoricul</value>
</data>
<data name="ClearHistoryConfirm" xml:space="preserve">
<value>Ștergi întregul istoric de consum al utilizatorului selectat?</value>
</data>
<data name="HistoryCleared" xml:space="preserve">
<value>Istoricul de consum a fost golit.</value>
</data>
<data name="ClearResumePoints" xml:space="preserve">
<value>Elimină din continuă vizionarea</value>
</data>
<data name="ClearResumePointsConfirm" xml:space="preserve">
<value>Elimini toate punctele de reluare ale utilizatorului selectat? Istoricul este păstrat.</value>
</data>
<data name="ResumePointsCleared" xml:space="preserve">
<value>Punctele de reluare au fost eliminate.</value>
</data>
<data name="Filters" xml:space="preserve">
<value>Filtre</value>
</data>
<data name="Library" xml:space="preserve">
<value>Bibliotecă</value>
</data>
<data name="AllLibraries" xml:space="preserve">
<value>Toate bibliotecile</value>
</data>
<data name="AllMediaKinds" xml:space="preserve">
<value>Toate tipurile de conținut</value>
</data>
<data name="From" xml:space="preserve">
<value>De la</value>
</data>
<data name="To" xml:space="preserve">
<value>Până la</value>
</data>
<data name="Apply" xml:space="preserve">
<value>Aplică</value>
</data>
<data name="Reset" xml:space="preserve">
<value>Resetează</value>
</data>
<data name="InvalidDateRange" xml:space="preserve">
<value>Data de început nu trebuie să fie după data de sfârșit.</value>
</data>
<data name="User" xml:space="preserve">
<value>Utilizator</value>
</data>
<data name="AllUsers" xml:space="preserve">
<value>Toți utilizatorii</value>
</data>
<data name="Me" xml:space="preserve">
<value>Eu</value>
</data>
<data name="AllUsersHistoryUnavailable" xml:space="preserve">
<value>Istoricul și defalcarea etichetelor sunt disponibile pentru fiecare utilizator. Selectează un utilizator pentru a le vedea.</value>
</data>
<data name="PerUser" xml:space="preserve">
<value>Per utilizator</value>
</data>
<data name="NoUsers" xml:space="preserve">
<value>Niciun utilizator nu are statistici de consum pentru aceste filtre.</value>
</data>
<data name="NoMediaKindData" xml:space="preserve">
<value>Nu există date despre tipul de conținut pentru aceste filtre.</value>
</data>
<data name="NoConsumption" xml:space="preserve">
<value>Nu există istoric de consum pentru aceste filtre.</value>
</data>
<data name="Loading" xml:space="preserve">
<value>Se încarcă...</value>
</data>
<data name="LoadFailed" xml:space="preserve">
<value>Statisticile nu au putut fi încărcate.</value>
@@ -45,20 +165,29 @@
<data name="Retry" xml:space="preserve">
<value>Reîncearcă</value>
</data>
<data name="Plays" xml:space="preserve">
<value>redări</value>
<data name="KindMusicTrack" xml:space="preserve">
<value>Pistă</value>
</data>
<data name="Completed" xml:space="preserve">
<value>finalizate</value>
<data name="KindPodcastEpisode" xml:space="preserve">
<value>Episod de podcast</value>
</data>
<data name="LastPlayed" xml:space="preserve">
<value>Ultima redare</value>
<data name="KindAudiobook" xml:space="preserve">
<value>Carte audio</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Redă piesa</value>
<data name="KindMovie" xml:space="preserve">
<value>Film</value>
</data>
<data name="AddToPlaylist" xml:space="preserve">
<value>Adaugă la playlist</value>
<data name="KindTvEpisode" xml:space="preserve">
<value>Episod TV</value>
</data>
<data name="KindBook" xml:space="preserve">
<value>Carte</value>
</data>
<data name="KindPhoto" xml:space="preserve">
<value>Fotografie</value>
</data>
<data name="KindVideo" xml:space="preserve">
<value>Videoclip</value>
</data>
<data name="HoursShort" xml:space="preserve">
<value>h</value>
@@ -69,4 +198,4 @@
<data name="SecondsShort" xml:space="preserve">
<value>s</value>
</data>
</root>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -15,29 +15,149 @@
<data name="Title" xml:space="preserve">
<value>Статистика</value>
</data>
<data name="TotalListeningTime" xml:space="preserve">
<value>Загальний час прослуховування</value>
<data name="TotalConsumedDuration" xml:space="preserve">
<value>Загальний спожитий час</value>
</data>
<data name="TotalPlays" xml:space="preserve">
<value>Відтворення</value>
<data name="CountedSessions" xml:space="preserve">
<value>Зараховані сеанси</value>
</data>
<data name="CompletedPlays" xml:space="preserve">
<value>Завершені відтворення</value>
<data name="CompletedSessions" xml:space="preserve">
<value>Завершені сеанси</value>
</data>
<data name="CompletionRate" xml:space="preserve">
<value>Відсоток завершення</value>
</data>
<data name="RecentlyPlayed" xml:space="preserve">
<value>Нещодавно відтворені</value>
<data name="ByMediaKind" xml:space="preserve">
<value>За типом медіа</value>
</data>
<data name="MostPlayed" xml:space="preserve">
<value>Найчастіше відтворювані</value>
<data name="MediaKind" xml:space="preserve">
<value>Тип медіа</value>
</data>
<data name="NoPlaysYet" xml:space="preserve">
<value>Ще немає зарахованих відтворень.</value>
<data name="Duration" xml:space="preserve">
<value>Час</value>
</data>
<data name="Stopped" xml:space="preserve">
<value>Зупинені</value>
</data>
<data name="Counted" xml:space="preserve">
<value>Зараховані</value>
</data>
<data name="Completed" xml:space="preserve">
<value>Завершені</value>
</data>
<data name="Genres" xml:space="preserve">
<value>Жанри</value>
</data>
<data name="Tags" xml:space="preserve">
<value>Теги</value>
</data>
<data name="NoGenres" xml:space="preserve">
<value>Немає даних про жанри для цих фільтрів.</value>
</data>
<data name="NoTags" xml:space="preserve">
<value>Немає даних про теги для цих фільтрів.</value>
</data>
<data name="Items" xml:space="preserve">
<value>елементів</value>
</data>
<data name="RecentlyConsumed" xml:space="preserve">
<value>Нещодавно спожиті</value>
</data>
<data name="MostConsumed" xml:space="preserve">
<value>Найбільш спожиті</value>
</data>
<data name="NoRecentlyConsumed" xml:space="preserve">
<value>Немає нещодавно спожитих елементів.</value>
</data>
<data name="NoMostConsumed" xml:space="preserve">
<value>Немає найбільш спожитих елементів.</value>
</data>
<data name="LastConsumed" xml:space="preserve">
<value>Останнє споживання</value>
</data>
<data name="Unavailable" xml:space="preserve">
<value>Цей трек більше недоступний.</value>
<value>Цей елемент більше недоступний.</value>
</data>
<data name="DeleteFromHistory" xml:space="preserve">
<value>Видалити з історії</value>
</data>
<data name="DeleteFromHistoryConfirm" xml:space="preserve">
<value>Видалити з історії всі записані сеанси цього елемента?</value>
</data>
<data name="HistoryEntryDeleted" xml:space="preserve">
<value>Запис історії видалено.</value>
</data>
<data name="ClearHistory" xml:space="preserve">
<value>Очистити історію</value>
</data>
<data name="ClearHistoryConfirm" xml:space="preserve">
<value>Видалити всю історію споживання вибраного користувача?</value>
</data>
<data name="HistoryCleared" xml:space="preserve">
<value>Історію споживання очищено.</value>
</data>
<data name="ClearResumePoints" xml:space="preserve">
<value>Видалити з продовження перегляду</value>
</data>
<data name="ClearResumePointsConfirm" xml:space="preserve">
<value>Видалити всі точки продовження вибраного користувача? Історія зберігається.</value>
</data>
<data name="ResumePointsCleared" xml:space="preserve">
<value>Точки продовження видалено.</value>
</data>
<data name="Filters" xml:space="preserve">
<value>Фільтри</value>
</data>
<data name="Library" xml:space="preserve">
<value>Бібліотека</value>
</data>
<data name="AllLibraries" xml:space="preserve">
<value>Усі бібліотеки</value>
</data>
<data name="AllMediaKinds" xml:space="preserve">
<value>Усі типи медіа</value>
</data>
<data name="From" xml:space="preserve">
<value>Від</value>
</data>
<data name="To" xml:space="preserve">
<value>До</value>
</data>
<data name="Apply" xml:space="preserve">
<value>Застосувати</value>
</data>
<data name="Reset" xml:space="preserve">
<value>Скинути</value>
</data>
<data name="InvalidDateRange" xml:space="preserve">
<value>Дата початку не може бути пізніше дати завершення.</value>
</data>
<data name="User" xml:space="preserve">
<value>Користувач</value>
</data>
<data name="AllUsers" xml:space="preserve">
<value>Усі користувачі</value>
</data>
<data name="Me" xml:space="preserve">
<value>Я</value>
</data>
<data name="AllUsersHistoryUnavailable" xml:space="preserve">
<value>Історія та розподіл тегів доступні для кожного користувача. Виберіть користувача, щоб переглянути їх.</value>
</data>
<data name="PerUser" xml:space="preserve">
<value>Для кожного користувача</value>
</data>
<data name="NoUsers" xml:space="preserve">
<value>Жоден користувач не має статистики споживання для цих фільтрів.</value>
</data>
<data name="NoMediaKindData" xml:space="preserve">
<value>Немає даних про тип медіа для цих фільтрів.</value>
</data>
<data name="NoConsumption" xml:space="preserve">
<value>Немає історії споживання для цих фільтрів.</value>
</data>
<data name="Loading" xml:space="preserve">
<value>Завантаження...</value>
</data>
<data name="LoadFailed" xml:space="preserve">
<value>Не вдалося завантажити статистику.</value>
@@ -45,20 +165,29 @@
<data name="Retry" xml:space="preserve">
<value>Повторити</value>
</data>
<data name="Plays" xml:space="preserve">
<value>відтворень</value>
<data name="KindMusicTrack" xml:space="preserve">
<value>Трек</value>
</data>
<data name="Completed" xml:space="preserve">
<value>завершено</value>
<data name="KindPodcastEpisode" xml:space="preserve">
<value>Епізод подкасту</value>
</data>
<data name="LastPlayed" xml:space="preserve">
<value>Останнє відтворення</value>
<data name="KindAudiobook" xml:space="preserve">
<value>Аудіокнига</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Відтворити трек</value>
<data name="KindMovie" xml:space="preserve">
<value>Фільм</value>
</data>
<data name="AddToPlaylist" xml:space="preserve">
<value>Додати до плейлиста</value>
<data name="KindTvEpisode" xml:space="preserve">
<value>Епізод телесеріалу</value>
</data>
<data name="KindBook" xml:space="preserve">
<value>Книга</value>
</data>
<data name="KindPhoto" xml:space="preserve">
<value>Фото</value>
</data>
<data name="KindVideo" xml:space="preserve">
<value>Відео</value>
</data>
<data name="HoursShort" xml:space="preserve">
<value>год</value>
@@ -69,4 +198,4 @@
<data name="SecondsShort" xml:space="preserve">
<value>с</value>
</data>
</root>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
@@ -15,29 +15,149 @@
<data name="Title" xml:space="preserve">
<value>统计</value>
</data>
<data name="TotalListeningTime" xml:space="preserve">
<value>总收听时间</value>
<data name="TotalConsumedDuration" xml:space="preserve">
<value>总消费时长</value>
</data>
<data name="TotalPlays" xml:space="preserve">
<value>播放次数</value>
<data name="CountedSessions" xml:space="preserve">
<value>计入的会话</value>
</data>
<data name="CompletedPlays" xml:space="preserve">
<value>完整播放次数</value>
<data name="CompletedSessions" xml:space="preserve">
<value>已完成的会话</value>
</data>
<data name="CompletionRate" xml:space="preserve">
<value>完成率</value>
</data>
<data name="RecentlyPlayed" xml:space="preserve">
<value>最近播放</value>
<data name="ByMediaKind" xml:space="preserve">
<value>按媒体类型</value>
</data>
<data name="MostPlayed" xml:space="preserve">
<value>最常播放</value>
<data name="MediaKind" xml:space="preserve">
<value>媒体类型</value>
</data>
<data name="NoPlaysYet" xml:space="preserve">
<value>还没有计入的播放。</value>
<data name="Duration" xml:space="preserve">
<value>时长</value>
</data>
<data name="Stopped" xml:space="preserve">
<value>已停止</value>
</data>
<data name="Counted" xml:space="preserve">
<value>已计入</value>
</data>
<data name="Completed" xml:space="preserve">
<value>已完成</value>
</data>
<data name="Genres" xml:space="preserve">
<value>类型</value>
</data>
<data name="Tags" xml:space="preserve">
<value>标签</value>
</data>
<data name="NoGenres" xml:space="preserve">
<value>这些筛选条件下没有类型数据。</value>
</data>
<data name="NoTags" xml:space="preserve">
<value>这些筛选条件下没有标签数据。</value>
</data>
<data name="Items" xml:space="preserve">
<value>项</value>
</data>
<data name="RecentlyConsumed" xml:space="preserve">
<value>最近消费</value>
</data>
<data name="MostConsumed" xml:space="preserve">
<value>最常消费</value>
</data>
<data name="NoRecentlyConsumed" xml:space="preserve">
<value>没有最近消费的项目。</value>
</data>
<data name="NoMostConsumed" xml:space="preserve">
<value>没有最常消费的项目。</value>
</data>
<data name="LastConsumed" xml:space="preserve">
<value>最近消费时间</value>
</data>
<data name="Unavailable" xml:space="preserve">
<value>此曲目已不可用。</value>
<value>此项目已不可用。</value>
</data>
<data name="DeleteFromHistory" xml:space="preserve">
<value>从历史记录中删除</value>
</data>
<data name="DeleteFromHistoryConfirm" xml:space="preserve">
<value>要从历史记录中删除此项目的所有已记录会话吗?</value>
</data>
<data name="HistoryEntryDeleted" xml:space="preserve">
<value>历史记录项已删除。</value>
</data>
<data name="ClearHistory" xml:space="preserve">
<value>清除历史记录</value>
</data>
<data name="ClearHistoryConfirm" xml:space="preserve">
<value>要删除所选用户的全部消费历史记录吗?</value>
</data>
<data name="HistoryCleared" xml:space="preserve">
<value>消费历史记录已清除。</value>
</data>
<data name="ClearResumePoints" xml:space="preserve">
<value>从继续观看中移除</value>
</data>
<data name="ClearResumePointsConfirm" xml:space="preserve">
<value>要移除所选用户的全部继续播放点吗?历史记录会保留。</value>
</data>
<data name="ResumePointsCleared" xml:space="preserve">
<value>继续播放点已移除。</value>
</data>
<data name="Filters" xml:space="preserve">
<value>筛选</value>
</data>
<data name="Library" xml:space="preserve">
<value>媒体库</value>
</data>
<data name="AllLibraries" xml:space="preserve">
<value>所有媒体库</value>
</data>
<data name="AllMediaKinds" xml:space="preserve">
<value>所有媒体类型</value>
</data>
<data name="From" xml:space="preserve">
<value>从</value>
</data>
<data name="To" xml:space="preserve">
<value>到</value>
</data>
<data name="Apply" xml:space="preserve">
<value>应用</value>
</data>
<data name="Reset" xml:space="preserve">
<value>重置</value>
</data>
<data name="InvalidDateRange" xml:space="preserve">
<value>开始日期不能晚于结束日期。</value>
</data>
<data name="User" xml:space="preserve">
<value>用户</value>
</data>
<data name="AllUsers" xml:space="preserve">
<value>所有用户</value>
</data>
<data name="Me" xml:space="preserve">
<value>我</value>
</data>
<data name="AllUsersHistoryUnavailable" xml:space="preserve">
<value>历史记录和标签明细按用户提供。请选择用户以查看。</value>
</data>
<data name="PerUser" xml:space="preserve">
<value>按用户</value>
</data>
<data name="NoUsers" xml:space="preserve">
<value>没有用户在这些筛选条件下有消费统计。</value>
</data>
<data name="NoMediaKindData" xml:space="preserve">
<value>这些筛选条件下没有媒体类型数据。</value>
</data>
<data name="NoConsumption" xml:space="preserve">
<value>这些筛选条件下没有消费历史记录。</value>
</data>
<data name="Loading" xml:space="preserve">
<value>正在加载...</value>
</data>
<data name="LoadFailed" xml:space="preserve">
<value>无法加载统计。</value>
@@ -45,28 +165,37 @@
<data name="Retry" xml:space="preserve">
<value>重试</value>
</data>
<data name="Plays" xml:space="preserve">
<value>次播放</value>
<data name="KindMusicTrack" xml:space="preserve">
<value>曲目</value>
</data>
<data name="Completed" xml:space="preserve">
<value>次完整播放</value>
<data name="KindPodcastEpisode" xml:space="preserve">
<value>播客单集</value>
</data>
<data name="LastPlayed" xml:space="preserve">
<value>上次播放</value>
<data name="KindAudiobook" xml:space="preserve">
<value>有声书</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>播放曲目</value>
<data name="KindMovie" xml:space="preserve">
<value>电影</value>
</data>
<data name="AddToPlaylist" xml:space="preserve">
<value>添加到播放列表</value>
<data name="KindTvEpisode" xml:space="preserve">
<value>电视单集</value>
</data>
<data name="KindBook" xml:space="preserve">
<value>书籍</value>
</data>
<data name="KindPhoto" xml:space="preserve">
<value>照片</value>
</data>
<data name="KindVideo" xml:space="preserve">
<value>视频</value>
</data>
<data name="HoursShort" xml:space="preserve">
<value>小时</value>
</data>
<data name="MinutesShort" xml:space="preserve">
<value>分钟</value>
<value>分</value>
</data>
<data name="SecondsShort" xml:space="preserve">
<value>秒</value>
</data>
</root>
</root>
File diff suppressed because it is too large. Load diff
+187 -17
View File
@@ -2255,8 +2255,53 @@ html.audio-player-initializing .audio-player-container {
font-size: 12px;
}
/* The statistics page: summary tiles, and the track rows of the recently played and most played lists. A row is a
track list, so its favorite heart is an inline action and never takes the place of a card heart. */
/* The statistics page: filters, summary tiles, breakdown tables, tag and genre bars, and the history rows. */
.statistics-page {
display: grid;
grid-template-rows: auto 1fr;
min-height: 100%;
padding: 0 2.5rem 2.5rem;
}
.statistics-user-selector {
display: flex;
align-items: flex-end;
margin-top: 1rem;
}
.statistics-filters {
display: flex;
flex-wrap: wrap;
align-items: flex-end;
gap: 1rem;
margin: 1.5rem 0;
}
.statistics-filter-field {
display: flex;
flex-direction: column;
gap: 4px;
}
.statistics-filter-buttons {
display: flex;
align-items: flex-end;
gap: 0.5rem;
}
.statistics-state {
color: #9AA7B0;
text-align: center;
margin: 1rem 0;
}
.statistics-summary {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 1rem;
margin: 1.5rem 0;
}
.statistics-summary-tile {
display: flex;
flex-direction: column;
@@ -2268,35 +2313,160 @@ html.audio-player-initializing .audio-player-container {
background: linear-gradient(to bottom, #505050 0%, #464646 35%, #404040 55%, #363636 100%);
}
.statistics-track-list {
.statistics-table-wrapper {
overflow-x: auto;
margin-bottom: 1.5rem;
}
.statistics-track-list:empty {
display: none;
.statistics-table {
width: 100%;
border-collapse: collapse;
}
/* The play counts and the last played time of a statistics row are separate lines, so the two values never run together. */
.statistics-track-metrics {
.statistics-table th,
.statistics-table td {
padding: 8px 10px;
text-align: left;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
white-space: nowrap;
}
.statistics-table th {
color: #9AA7B0;
font-weight: normal;
}
.statistics-media-kind-badge {
display: inline-block;
padding: 2px 8px;
border: 1px solid #777777;
border-radius: 3px;
background: rgba(0, 0, 0, 0.15);
color: #d8d8d8;
font-size: 12px;
line-height: 1.4;
white-space: nowrap;
}
.statistics-terms {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 2rem;
margin-bottom: 1.5rem;
}
.statistics-terms-column {
min-width: 0;
}
.statistics-bars {
display: flex;
flex-direction: column;
gap: 8px;
}
.statistics-bar-row {
display: grid;
grid-template-columns: minmax(90px, 1fr) minmax(80px, 2fr) auto;
align-items: center;
gap: 10px;
}
.statistics-term-name {
color: #d8d8d8;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.statistics-bar-track {
height: 10px;
border: 1px solid #777777;
background: rgba(0, 0, 0, 0.25);
overflow: hidden;
}
.statistics-bar-fill {
height: 100%;
background: #8fb5c9;
}
.statistics-term-meta {
color: #9AA7B0;
font-size: 12px;
white-space: nowrap;
}
.statistics-history-section {
margin-top: 1.5rem;
}
.statistics-history-actions {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-bottom: 1rem;
}
.statistics-item-list {
margin-bottom: 1.5rem;
}
.statistics-item-row {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.5rem 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.statistics-item-cover {
width: 48px;
height: 48px;
object-fit: cover;
border-radius: 4px;
flex-shrink: 0;
}
.statistics-item-details {
display: flex;
flex-direction: column;
gap: 2px;
flex-grow: 1;
min-width: 0;
}
.statistics-item-title {
color: #d8d8d8;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.statistics-item-meta {
color: #9AA7B0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.statistics-item-metrics {
display: flex;
flex: 0 0 auto;
flex-direction: column;
align-items: flex-end;
gap: 2px;
text-align: right;
white-space: nowrap;
}
.statistics-track-actions .card-favorite-toggle {
position: static;
.statistics-item-actions {
display: flex;
flex: 0 0 auto;
margin: 0;
align-items: center;
gap: 0.25rem;
flex-shrink: 0;
}
.statistics-action-button {
width: 28px;
min-width: 28px;
height: 28px;
padding: 0;
line-height: 1;
.statistics-delete-button {
white-space: nowrap;
}