First POC with working playback
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Jellyfin.Plugin.JellyLMS.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the current playback state.
|
||||
/// </summary>
|
||||
public enum PlaybackState
|
||||
{
|
||||
/// <summary>
|
||||
/// Playback is stopped.
|
||||
/// </summary>
|
||||
Stopped,
|
||||
|
||||
/// <summary>
|
||||
/// Playback is active.
|
||||
/// </summary>
|
||||
Playing,
|
||||
|
||||
/// <summary>
|
||||
/// Playback is paused.
|
||||
/// </summary>
|
||||
Paused
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an active playback session bridging Jellyfin to LMS.
|
||||
/// </summary>
|
||||
public class LmsPlaybackSession
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique session identifier.
|
||||
/// </summary>
|
||||
public string SessionId { get; set; } = Guid.NewGuid().ToString();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Jellyfin session ID.
|
||||
/// </summary>
|
||||
public string? JellyfinSessionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Jellyfin item ID being played.
|
||||
/// </summary>
|
||||
public Guid ItemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the item name for display.
|
||||
/// </summary>
|
||||
public string ItemName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the artist name (for audio).
|
||||
/// </summary>
|
||||
public string? Artist { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the album name (for audio).
|
||||
/// </summary>
|
||||
public string? Album { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MAC addresses of LMS players in this session.
|
||||
/// </summary>
|
||||
public List<string> PlayerMacs { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current playback state.
|
||||
/// </summary>
|
||||
public PlaybackState State { get; set; } = PlaybackState.Stopped;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current playback position in ticks.
|
||||
/// </summary>
|
||||
public long PositionTicks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the total runtime in ticks.
|
||||
/// </summary>
|
||||
public long RuntimeTicks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets when this session started.
|
||||
/// </summary>
|
||||
public DateTime StartedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the audio stream URL being played on LMS.
|
||||
/// </summary>
|
||||
public string? StreamUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Jellyfin user ID who initiated playback.
|
||||
/// </summary>
|
||||
public Guid? UserId { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user