jellypod/Jellyfin.Plugin.Jellypod/Services/IPodcastDownloadService.cs
Duncan Tourolle 4679b77d1a
Some checks failed
🏗️ Build Plugin / call (push) Failing after 0s
📝 Create/Update Release Draft & Release Bump PR / call (push) Failing after 0s
🔬 Run CodeQL / call (push) Failing after 0s
🧪 Test Plugin / call (push) Failing after 0s
First POC with podcasts library
2025-12-13 23:57:58 +01:00

50 lines
1.8 KiB
C#

using System;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Plugin.Jellypod.Models;
namespace Jellyfin.Plugin.Jellypod.Services;
/// <summary>
/// Service for downloading podcast episodes.
/// </summary>
public interface IPodcastDownloadService
{
/// <summary>
/// Queues an episode for download.
/// </summary>
/// <param name="podcast">The podcast.</param>
/// <param name="episode">The episode to download.</param>
/// <returns>Task representing the queue operation.</returns>
Task QueueDownloadAsync(Podcast podcast, Episode episode);
/// <summary>
/// Downloads an episode immediately.
/// </summary>
/// <param name="podcast">The podcast.</param>
/// <param name="episode">The episode to download.</param>
/// <param name="progress">Optional progress reporter.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The local file path of the downloaded episode.</returns>
Task<string> DownloadEpisodeAsync(
Podcast podcast,
Episode episode,
IProgress<double>? progress = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Deletes a downloaded episode file.
/// </summary>
/// <param name="episode">The episode whose file to delete.</param>
/// <returns>Task representing the delete operation.</returns>
Task DeleteEpisodeFileAsync(Episode episode);
/// <summary>
/// Downloads podcast artwork.
/// </summary>
/// <param name="podcast">The podcast.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Task representing the download operation.</returns>
Task DownloadPodcastArtworkAsync(Podcast podcast, CancellationToken cancellationToken = default);
}