Duncan Tourolle 003a8754a6
All checks were successful
🚀 Release Plugin / build-and-release (push) Successful in 2m3s
🏗️ Build Plugin / build (push) Successful in 2m0s
🧪 Test Plugin / test (push) Successful in 59s
Added OPML support
2025-12-16 20:31:46 +01:00

45 lines
1.4 KiB
C#

using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Plugin.Jellypod.Api.Models;
using Jellyfin.Plugin.Jellypod.Models;
namespace Jellyfin.Plugin.Jellypod.Services;
/// <summary>
/// Service for handling OPML import and export.
/// </summary>
public interface IOpmlService
{
/// <summary>
/// Parses OPML content and extracts podcast outlines.
/// </summary>
/// <param name="opmlContent">The OPML XML content.</param>
/// <returns>List of parsed outlines.</returns>
IReadOnlyList<OpmlOutline> ParseOpml(string opmlContent);
/// <summary>
/// Parses OPML from a stream.
/// </summary>
/// <param name="stream">The input stream containing OPML XML.</param>
/// <returns>List of parsed outlines.</returns>
IReadOnlyList<OpmlOutline> ParseOpml(Stream stream);
/// <summary>
/// Imports podcasts from parsed OPML outlines.
/// </summary>
/// <param name="outlines">The parsed OPML outlines.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Import result with statistics.</returns>
Task<OpmlImportResult> ImportPodcastsAsync(
IReadOnlyList<OpmlOutline> outlines,
CancellationToken cancellationToken = default);
/// <summary>
/// Exports all subscribed podcasts to OPML format.
/// </summary>
/// <returns>OPML XML string.</returns>
Task<string> ExportToOpmlAsync();
}