mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15:11:10 +00:00
Adds the music play statistics endpoints and moves the Web statistics page under the library
This commit is contained in:
1 parent
dfd979ec1e
commit
a61fbf407c
69 files changed
+3407
-7
No files matched your search
+16
@@ -0,0 +1,16 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.PlayHistory;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request for getting a window 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 when a page size is provided.</param>
|
||||
/// <param name="PerPage">The number of tracks per page. Optional; defaults to 50 when a page is provided. When both pagination parameters are omitted, every matching track is returned.</param>
|
||||
[DebuggerDisplay("CurrentPage: {CurrentPage}; PerPage: {PerPage}")]
|
||||
public record GetMostPlayedRequest(
|
||||
int? CurrentPage,
|
||||
int? PerPage
|
||||
);
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.PlayHistory;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request for getting a window 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 when a page size is provided.</param>
|
||||
/// <param name="PerPage">The number of tracks per page. Optional; defaults to 50 when a page is provided. When both pagination parameters are omitted, every matching track is returned.</param>
|
||||
[DebuggerDisplay("CurrentPage: {CurrentPage}; PerPage: {PerPage}")]
|
||||
public record GetRecentlyPlayedRequest(
|
||||
int? CurrentPage,
|
||||
int? PerPage
|
||||
);
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.PlayHistory;
|
||||
|
||||
/// <summary>
|
||||
/// Represents 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 MusicPlayStatisticsResponse(
|
||||
double TotalListeningDurationInSeconds,
|
||||
int TotalPlayCount,
|
||||
int CompletedPlayCount,
|
||||
int StoppedPlayCount,
|
||||
double CompletionRate
|
||||
);
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.PlayHistory;
|
||||
|
||||
/// <summary>
|
||||
/// Represents 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 PlayedTrackResponse(
|
||||
Guid TrackId,
|
||||
Guid LibraryId,
|
||||
Guid AlbumId,
|
||||
Guid ArtistId,
|
||||
string? Title,
|
||||
string? AlbumTitle,
|
||||
string? ArtistName,
|
||||
string? CoverPath,
|
||||
DateTime LastPlayedOnUtc,
|
||||
int PlayCount,
|
||||
int CompletedPlayCount,
|
||||
double ListenedDurationInSeconds
|
||||
);
|
||||
Reference in new issue
Block a user