Duncan Tourolle 7c76402a4a
Some checks failed
🏗️ Build Plugin / build (push) Failing after 9s
🧪 Test Plugin / test (push) Successful in 1m28s
🚀 Release Plugin / build-and-release (push) Failing after 5s
Clean up dead code, consolidate duplication, fix redundancies
Remove 9 dead methods, 6 unused constants, and redundant
ReaderWriterLockSlim from MetadataCache. Consolidate repeated
patterns into HasChapters, IsPlayable, and ToLowerString helpers.
Extract shared API methods in SRFApiClient. Move variant manifest
rewriting from controller to StreamProxyService. Make Auto quality
distinct from HD. Update README architecture section.
2026-02-28 11:34:45 +01:00

61 lines
1.7 KiB
C#

using System.Text.Json.Serialization;
namespace Jellyfin.Plugin.SRFPlay.Api.Models;
// NOTE: DrmList is typed as object? because the SRF API returns either null or a JSON array.
// IsPlayable checks for both null and empty array ("[]") to determine if content is DRM-free.
/// <summary>
/// Represents a streaming resource (URL) in the SRF API response.
/// </summary>
public class Resource
{
/// <summary>
/// Gets or sets the stream URL.
/// </summary>
[JsonPropertyName("url")]
public string Url { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the streaming protocol (e.g., HLS, DASH).
/// </summary>
[JsonPropertyName("protocol")]
public string? Protocol { get; set; }
/// <summary>
/// Gets or sets the quality level (e.g., HD, SD).
/// </summary>
[JsonPropertyName("quality")]
public string? Quality { get; set; }
/// <summary>
/// Gets or sets the streaming method.
/// </summary>
[JsonPropertyName("streaming")]
public string? Streaming { get; set; }
/// <summary>
/// Gets or sets the MIME type.
/// </summary>
[JsonPropertyName("mimeType")]
public string? MimeType { get; set; }
/// <summary>
/// Gets or sets the encoding.
/// </summary>
[JsonPropertyName("encoding")]
public string? Encoding { get; set; }
/// <summary>
/// Gets or sets whether DRM is required.
/// </summary>
[JsonPropertyName("drmList")]
public object? DrmList { get; set; }
/// <summary>
/// Gets a value indicating whether this resource is playable (not DRM-protected).
/// </summary>
[JsonIgnore]
public bool IsPlayable => DrmList == null || DrmList.ToString() == "[]";
}