Add recording of livestreams
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Jellyfin.Plugin.SRFPlay.Api.Models;
|
||||
|
||||
/// <summary>
|
||||
/// A scheduled or active recording.
|
||||
/// </summary>
|
||||
public class RecordingEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique recording ID.
|
||||
/// </summary>
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SRF URN.
|
||||
/// </summary>
|
||||
[JsonPropertyName("urn")]
|
||||
public string Urn { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the title.
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the description.
|
||||
/// </summary>
|
||||
[JsonPropertyName("description")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the image URL.
|
||||
/// </summary>
|
||||
[JsonPropertyName("imageUrl")]
|
||||
public string? ImageUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets when the livestream starts.
|
||||
/// </summary>
|
||||
[JsonPropertyName("validFrom")]
|
||||
public DateTime? ValidFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets when the livestream ends.
|
||||
/// </summary>
|
||||
[JsonPropertyName("validTo")]
|
||||
public DateTime? ValidTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the recording state.
|
||||
/// </summary>
|
||||
[JsonPropertyName("state")]
|
||||
public RecordingState State { get; set; } = RecordingState.Scheduled;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the output file path.
|
||||
/// </summary>
|
||||
[JsonPropertyName("outputPath")]
|
||||
public string? OutputPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets when the recording actually started.
|
||||
/// </summary>
|
||||
[JsonPropertyName("recordingStartedAt")]
|
||||
public DateTime? RecordingStartedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets when the recording ended.
|
||||
/// </summary>
|
||||
[JsonPropertyName("recordingEndedAt")]
|
||||
public DateTime? RecordingEndedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the file size in bytes.
|
||||
/// </summary>
|
||||
[JsonPropertyName("fileSizeBytes")]
|
||||
public long? FileSizeBytes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the error message if recording failed.
|
||||
/// </summary>
|
||||
[JsonPropertyName("errorMessage")]
|
||||
public string? ErrorMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets when this entry was created.
|
||||
/// </summary>
|
||||
[JsonPropertyName("createdAt")]
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace Jellyfin.Plugin.SRFPlay.Api.Models;
|
||||
|
||||
/// <summary>
|
||||
/// State of a recording.
|
||||
/// </summary>
|
||||
public enum RecordingState
|
||||
{
|
||||
/// <summary>Scheduled for future recording.</summary>
|
||||
Scheduled,
|
||||
|
||||
/// <summary>Waiting for stream to become available.</summary>
|
||||
WaitingForStream,
|
||||
|
||||
/// <summary>Currently recording.</summary>
|
||||
Recording,
|
||||
|
||||
/// <summary>Recording completed successfully.</summary>
|
||||
Completed,
|
||||
|
||||
/// <summary>Recording failed.</summary>
|
||||
Failed,
|
||||
|
||||
/// <summary>Recording was cancelled.</summary>
|
||||
Cancelled
|
||||
}
|
||||
Reference in New Issue
Block a user