jellypod/Jellyfin.Plugin.Jellypod/Services/IPodcastStorageService.cs
Duncan Tourolle c54221fba2
All checks were successful
🏗️ Build Plugin / build (push) Successful in 2m2s
🧪 Test Plugin / test (push) Successful in 58s
Fix bug where stale cache causes media player to mix up episode names
2025-12-30 15:53:31 +01:00

73 lines
2.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Jellyfin.Plugin.Jellypod.Models;
namespace Jellyfin.Plugin.Jellypod.Services;
/// <summary>
/// Service for storing and retrieving podcast data.
/// </summary>
public interface IPodcastStorageService
{
/// <summary>
/// Gets the cached last modification time (synchronous, for cache key generation).
/// Returns default if database hasn't been loaded yet.
/// </summary>
DateTime LastModified { get; }
/// <summary>
/// Gets all subscribed podcasts.
/// </summary>
/// <returns>List of all podcasts.</returns>
Task<IReadOnlyList<Podcast>> GetAllPodcastsAsync();
/// <summary>
/// Gets a podcast by its ID.
/// </summary>
/// <param name="id">The podcast ID.</param>
/// <returns>The podcast, or null if not found.</returns>
Task<Podcast?> GetPodcastAsync(Guid id);
/// <summary>
/// Adds a new podcast subscription.
/// </summary>
/// <param name="podcast">The podcast to add.</param>
/// <returns>Task representing the operation.</returns>
Task AddPodcastAsync(Podcast podcast);
/// <summary>
/// Updates an existing podcast.
/// </summary>
/// <param name="podcast">The podcast to update.</param>
/// <returns>Task representing the operation.</returns>
Task UpdatePodcastAsync(Podcast podcast);
/// <summary>
/// Deletes a podcast subscription.
/// </summary>
/// <param name="id">The podcast ID to delete.</param>
/// <returns>Task representing the operation.</returns>
Task DeletePodcastAsync(Guid id);
/// <summary>
/// Gets the local file path for an episode.
/// </summary>
/// <param name="podcast">The parent podcast.</param>
/// <param name="episode">The episode.</param>
/// <returns>The file path where the episode should be stored.</returns>
string GetEpisodeFilePath(Podcast podcast, Episode episode);
/// <summary>
/// Gets the storage path for podcasts.
/// </summary>
/// <returns>The base path for podcast storage.</returns>
string GetStoragePath();
/// <summary>
/// Gets the last time the database was modified.
/// </summary>
/// <returns>The last modification time, or null if unknown.</returns>
Task<DateTime?> GetLastModifiedAsync();
}