refactor to unify data fetching and define abstract API for re-use
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using Jellyfin.Plugin.SRFPlay.Api.Models;
|
||||
|
||||
namespace Jellyfin.Plugin.SRFPlay.Services.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for caching metadata from SRF API.
|
||||
/// </summary>
|
||||
public interface IMetadataCache
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets cached media composition by URN.
|
||||
/// </summary>
|
||||
/// <param name="urn">The URN.</param>
|
||||
/// <param name="cacheDurationMinutes">The cache duration in minutes.</param>
|
||||
/// <returns>The cached media composition, or null if not found or expired.</returns>
|
||||
MediaComposition? GetMediaComposition(string urn, int cacheDurationMinutes);
|
||||
|
||||
/// <summary>
|
||||
/// Sets media composition in cache.
|
||||
/// </summary>
|
||||
/// <param name="urn">The URN.</param>
|
||||
/// <param name="mediaComposition">The media composition to cache.</param>
|
||||
void SetMediaComposition(string urn, MediaComposition mediaComposition);
|
||||
|
||||
/// <summary>
|
||||
/// Removes media composition from cache.
|
||||
/// </summary>
|
||||
/// <param name="urn">The URN.</param>
|
||||
void RemoveMediaComposition(string urn);
|
||||
|
||||
/// <summary>
|
||||
/// Clears all cached data.
|
||||
/// </summary>
|
||||
void Clear();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the cache statistics.
|
||||
/// </summary>
|
||||
/// <returns>A tuple with cache count and size estimate.</returns>
|
||||
(int Count, long SizeEstimate) GetStatistics();
|
||||
}
|
||||
Reference in New Issue
Block a user