diff options
| author | Nils Fürniß <contact@nalsai.de> | 2022-03-09 20:47:03 +0100 |
|---|---|---|
| committer | Nils Fürniß <contact@nalsai.de> | 2022-03-22 19:17:48 +0100 |
| commit | 6904edf68c359cff56b5e6cae9c1d05e2173cd18 (patch) | |
| tree | 82fd38a8c70c256cb14d76e4d3ff0628dfa773c2 /Jellyfin.Api/Helpers/TranscodingJobHelper.cs | |
| parent | c512e783b34fe67c523e1f71a930c23219669f14 (diff) | |
add extracting attachments from external subs
Diffstat (limited to 'Jellyfin.Api/Helpers/TranscodingJobHelper.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/TranscodingJobHelper.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs index 49a394868..3235da292 100644 --- a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs +++ b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs @@ -13,6 +13,7 @@ using Jellyfin.Api.Models.StreamingDtos; using Jellyfin.Data.Enums; using MediaBrowser.Common; using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.MediaEncoding; @@ -530,6 +531,15 @@ namespace Jellyfin.Api.Helpers { var attachmentPath = Path.Combine(_appPaths.CachePath, "attachments", state.MediaSource.Id); await _attachmentExtractor.ExtractAllAttachments(state.MediaPath, state.MediaSource, attachmentPath, CancellationToken.None).ConfigureAwait(false); + + if (state.SubtitleStream.IsExternal) + { + string subtitlePath = state.SubtitleStream.Path; + string 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); + } } var process = new Process |
