remove redundant restAPI
playback is controlled by state machine
This commit is contained in:
@@ -9,9 +9,14 @@ namespace Jellyfin.Plugin.JellyLMS.Models;
|
||||
public enum PlaybackState
|
||||
{
|
||||
/// <summary>
|
||||
/// Playback is stopped.
|
||||
/// Device connected, no media loaded.
|
||||
/// </summary>
|
||||
Stopped,
|
||||
Idle,
|
||||
|
||||
/// <summary>
|
||||
/// Play command sent, waiting for LMS to confirm playback started.
|
||||
/// </summary>
|
||||
Loading,
|
||||
|
||||
/// <summary>
|
||||
/// Playback is active.
|
||||
@@ -21,7 +26,84 @@ public enum PlaybackState
|
||||
/// <summary>
|
||||
/// Playback is paused.
|
||||
/// </summary>
|
||||
Paused
|
||||
Paused,
|
||||
|
||||
/// <summary>
|
||||
/// Position change in progress.
|
||||
/// </summary>
|
||||
Seeking,
|
||||
|
||||
/// <summary>
|
||||
/// Playback failed with an error.
|
||||
/// </summary>
|
||||
Error,
|
||||
|
||||
/// <summary>
|
||||
/// Playback has ended.
|
||||
/// </summary>
|
||||
Stopped
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Types of playback errors.
|
||||
/// </summary>
|
||||
public enum PlaybackErrorType
|
||||
{
|
||||
/// <summary>
|
||||
/// No error.
|
||||
/// </summary>
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// Operation timed out waiting for LMS response.
|
||||
/// </summary>
|
||||
Timeout,
|
||||
|
||||
/// <summary>
|
||||
/// Network error communicating with LMS.
|
||||
/// </summary>
|
||||
NetworkError,
|
||||
|
||||
/// <summary>
|
||||
/// LMS returned an error.
|
||||
/// </summary>
|
||||
LmsError,
|
||||
|
||||
/// <summary>
|
||||
/// Error with the audio stream from Jellyfin.
|
||||
/// </summary>
|
||||
StreamError,
|
||||
|
||||
/// <summary>
|
||||
/// Unknown error.
|
||||
/// </summary>
|
||||
Unknown
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Contains details about a playback error.
|
||||
/// </summary>
|
||||
public class PlaybackErrorInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the type of error.
|
||||
/// </summary>
|
||||
public PlaybackErrorType ErrorType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the error message.
|
||||
/// </summary>
|
||||
public string Message { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets when the error occurred.
|
||||
/// </summary>
|
||||
public DateTime OccurredAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of retry attempts made.
|
||||
/// </summary>
|
||||
public int RetryCount { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -67,7 +149,12 @@ public class LmsPlaybackSession
|
||||
/// <summary>
|
||||
/// Gets or sets the current playback state.
|
||||
/// </summary>
|
||||
public PlaybackState State { get; set; } = PlaybackState.Stopped;
|
||||
public PlaybackState State { get; set; } = PlaybackState.Idle;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the last error that occurred during playback.
|
||||
/// </summary>
|
||||
public PlaybackErrorInfo? LastError { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current playback position in ticks.
|
||||
|
||||
Reference in New Issue
Block a user