refactor to unify data fetching and define abstract API for re-use
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user