jellyfin/MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.cs
Tim Eisele 596b635511
Cleanup extracted files (#13760)
* Cleanup extracted files

* Pagination and fixes

* Add migration for attachments to MigrateLibraryDb

* Unify attachment handling

* Don't extract again if files were already extracted

* Fix MKS attachment extraction

* Always run full extraction on mks

* Don't try to extract mjpeg streams as attachments

* Fallback to check if attachments were extracted to cache folder

* Fixup
2025-04-03 09:17:14 -06:00

41 lines
1.4 KiB
C#

#nullable disable
#pragma warning disable CS1591
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.MediaEncoding;
public interface IAttachmentExtractor
{
/// <summary>
/// Gets the path to the attachment file.
/// </summary>
/// <param name="item">The <see cref="BaseItem"/>.</param>
/// <param name="mediaSourceId">The media source id.</param>
/// <param name="attachmentStreamIndex">The attachment index.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The async task.</returns>
Task<(MediaAttachment Attachment, Stream Stream)> GetAttachment(
BaseItem item,
string mediaSourceId,
int attachmentStreamIndex,
CancellationToken cancellationToken);
/// <summary>
/// Gets the path to the attachment file.
/// </summary>
/// <param name="inputFile">The input file path.</param>
/// <param name="mediaSource">The <see cref="MediaSourceInfo" /> source id.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The async task.</returns>
Task ExtractAllAttachments(
string inputFile,
MediaSourceInfo mediaSource,
CancellationToken cancellationToken);
}