The Free Software Media System - Server Backend & API
Pass CancellationToken to ExtractAllAttachments
Nils Fürniß90463d5e4f83
diff --git a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs b/Jellyfin.Api/Helpers/TranscodingJobHelper.csindex 3235da2920..d8479de2dd 100644--- a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs+++ b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs@@ -530,7 +530,7 @@ namespace Jellyfin.Api.Helpersif (state.SubtitleStream != null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode){var attachmentPath = Path.Combine(_appPaths.CachePath, "attachments", state.MediaSource.Id);- await _attachmentExtractor.ExtractAllAttachments(state.MediaPath, state.MediaSource, attachmentPath, CancellationToken.None).ConfigureAwait(false);+ await _attachmentExtractor.ExtractAllAttachments(state.MediaPath, state.MediaSource, attachmentPath, cancellationTokenSource.Token).ConfigureAwait(false);if (state.SubtitleStream.IsExternal){@@ -538,7 +538,7 @@ namespace Jellyfin.Api.Helpersstring subtitlePathArgument = string.Format(CultureInfo.InvariantCulture, "file:\"{0}\"", subtitlePath.Replace("\"", "\\\"", StringComparison.Ordinal));string subtitleId = subtitlePath.GetMD5().ToString("N", CultureInfo.InvariantCulture);- await _attachmentExtractor.ExtractAllAttachmentsExternal(subtitlePathArgument, subtitleId, attachmentPath, CancellationToken.None).ConfigureAwait(false);+ await _attachmentExtractor.ExtractAllAttachmentsExternal(subtitlePathArgument, subtitleId, attachmentPath, cancellationTokenSource.Token).ConfigureAwait(false);}}diff --git a/MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.cs b/MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.csindex cffc60ba37..09840d2eea 100644--- a/MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.cs+++ b/MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.cs@@ -18,11 +18,13 @@ namespace MediaBrowser.Controller.MediaEncodingstring mediaSourceId,int attachmentStreamIndex,CancellationToken cancellationToken);+Task ExtractAllAttachments(string inputFile,MediaSourceInfo mediaSource,string outputPath,CancellationToken cancellationToken);+Task ExtractAllAttachmentsExternal(string inputArgument,string id,