using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Plugin.SRFPlay.Api.Models;
using Jellyfin.Plugin.SRFPlay.Api.Models.PlayV3;
namespace Jellyfin.Plugin.SRFPlay.Services.Interfaces;
///
/// Service for managing sport livestream recordings.
///
public interface IRecordingService
{
///
/// Gets upcoming sport livestreams that can be recorded.
///
/// The cancellation token.
/// List of upcoming sport livestreams.
Task> GetUpcomingScheduleAsync(CancellationToken cancellationToken = default);
///
/// Schedules a livestream for recording.
///
/// The SRF URN to record.
/// The cancellation token.
/// The created recording entry.
Task ScheduleRecordingAsync(string urn, CancellationToken cancellationToken = default);
///
/// Cancels a scheduled recording.
///
/// The recording ID.
/// True if cancelled.
bool CancelRecording(string recordingId);
///
/// Stops an active recording.
///
/// The recording ID.
/// True if stopped.
bool StopRecording(string recordingId);
///
/// Gets all recordings by state.
///
/// Optional state filter.
/// List of matching recording entries.
IReadOnlyList GetRecordings(RecordingState? stateFilter = null);
///
/// Deletes a completed recording (entry and optionally the file).
///
/// The recording ID.
/// Whether to delete the file too.
/// True if deleted.
bool DeleteRecording(string recordingId, bool deleteFile = true);
///
/// Checks scheduled recordings and starts/stops them as needed.
/// Called periodically by the scheduler task.
///
/// The cancellation token.
/// A task representing the async operation.
Task ProcessRecordingsAsync(CancellationToken cancellationToken = default);
}