mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 08:11:10 +00:00
Adds music player consumption reporting and its Web proxy endpoints
This commit is contained in:
1 parent
00d7eff777
commit
bfa7b190b2
20 files changed
+1599
-21
No files matched your search
+18
@@ -0,0 +1,18 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Requests.MediaConsumption;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to report that a media consumption session completed.
|
||||
/// </summary>
|
||||
/// <param name="Position">The final position reported for the media item, if the client knows it. Optional.</param>
|
||||
/// <param name="ProgressFraction">The fraction of the media item that the client reached, between 0 and 1. Required.</param>
|
||||
/// <param name="ConsumedDurationInSeconds">The active duration consumed by the session, in seconds. Required.</param>
|
||||
[DebuggerDisplay("ProgressFraction: {ProgressFraction}; ConsumedDurationInSeconds: {ConsumedDurationInSeconds}")]
|
||||
public sealed record CompleteConsumptionRequest(
|
||||
MediaPositionRequest? Position,
|
||||
double? ProgressFraction,
|
||||
double? ConsumedDurationInSeconds
|
||||
);
|
||||
@@ -0,0 +1,18 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Requests.MediaConsumption;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to report a position in a media consumption session.
|
||||
/// </summary>
|
||||
/// <param name="Kind">The kind of the position. Required.</param>
|
||||
/// <param name="TimeOffsetSeconds">The position within the media item, in seconds, when the position is a time offset. Optional.</param>
|
||||
/// <param name="Location">The opaque locator within the media item, when the position is not a time offset. Optional.</param>
|
||||
[DebuggerDisplay("Kind: {Kind}; TimeOffsetSeconds: {TimeOffsetSeconds}")]
|
||||
public sealed record MediaPositionRequest(
|
||||
string? Kind,
|
||||
double? TimeOffsetSeconds,
|
||||
string? Location
|
||||
);
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Requests.MediaConsumption;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to report the progress of a media consumption session.
|
||||
/// </summary>
|
||||
/// <param name="Position">The last position reported for the media item, if the client knows it. Optional.</param>
|
||||
/// <param name="ProgressFraction">The fraction of the media item that the client reached, between 0 and 1. Required.</param>
|
||||
/// <param name="ConsumedDurationInSeconds">The active duration consumed by the session, in seconds. Required.</param>
|
||||
/// <param name="ConsecutivePagesRead">The number of consecutive pages read in the current session, used by page based media such as books and ignored for other kinds. Defaults to 0. Optional.</param>
|
||||
[DebuggerDisplay("ProgressFraction: {ProgressFraction}; ConsumedDurationInSeconds: {ConsumedDurationInSeconds}; ConsecutivePagesRead: {ConsecutivePagesRead}")]
|
||||
public sealed record ReportConsumptionProgressRequest(
|
||||
MediaPositionRequest? Position,
|
||||
double? ProgressFraction,
|
||||
double? ConsumedDurationInSeconds,
|
||||
int ConsecutivePagesRead = 0
|
||||
);
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Common.Requests.MediaConsumption;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to report that a media consumption session stopped.
|
||||
/// </summary>
|
||||
/// <param name="Position">The final position reported for the media item, if the client knows it. Optional.</param>
|
||||
/// <param name="ProgressFraction">The fraction of the media item that the client reached, between 0 and 1. Required.</param>
|
||||
/// <param name="ConsumedDurationInSeconds">The active duration consumed by the session, in seconds. Required.</param>
|
||||
[DebuggerDisplay("ProgressFraction: {ProgressFraction}; ConsumedDurationInSeconds: {ConsumedDurationInSeconds}")]
|
||||
public sealed record StopConsumptionRequest(
|
||||
MediaPositionRequest? Position,
|
||||
double? ProgressFraction,
|
||||
double? ConsumedDurationInSeconds
|
||||
);
|
||||
Reference in new issue
Block a user