using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Plugin.SRFPlay.Api.Models;

namespace Jellyfin.Plugin.SRFPlay.Services.Interfaces;

/// <summary>
/// Interface for fetching media composition with caching support.
/// </summary>
public interface IMediaCompositionFetcher
{
    /// <summary>
    /// Gets media composition by URN, using cache if available.
    /// </summary>
    /// <param name="urn">The URN to fetch.</param>
    /// <param name="cancellationToken">Cancellation token.</param>
    /// <param name="cacheDurationOverride">Optional override for cache duration (e.g., 5 min for livestreams).</param>
    /// <returns>The media composition, or null if not found.</returns>
    Task<MediaComposition?> GetMediaCompositionAsync(
        string urn,
        CancellationToken cancellationToken,
        int? cacheDurationOverride = null);
}
