Merge pull request #12575 from dmitrylyzo/fix-subtitleextract

Fix subtitle and attachment extraction when input path contains quotes
This commit is contained in:
Bond-009 2024-09-07 22:07:05 +02:00 committed by GitHub
commit 3c3ebe8344
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -284,7 +284,7 @@ namespace MediaBrowser.MediaEncoding.Attachments
if (extractableAttachmentIds.Count > 0) if (extractableAttachmentIds.Count > 0)
{ {
await CacheAllAttachmentsInternal(mediaPath, inputFile, mediaSource, extractableAttachmentIds, cancellationToken).ConfigureAwait(false); await CacheAllAttachmentsInternal(mediaPath, _mediaEncoder.GetInputArgument(inputFile, mediaSource), mediaSource, extractableAttachmentIds, cancellationToken).ConfigureAwait(false);
} }
} }
catch (Exception ex) catch (Exception ex)
@ -323,7 +323,7 @@ namespace MediaBrowser.MediaEncoding.Attachments
processArgs += string.Format( processArgs += string.Format(
CultureInfo.InvariantCulture, CultureInfo.InvariantCulture,
" -i \"{0}\" -t 0 -f null null", " -i {0} -t 0 -f null null",
inputFile); inputFile);
int exitCode; int exitCode;

View File

@ -501,11 +501,11 @@ namespace MediaBrowser.MediaEncoding.Subtitles
List<MediaStream> subtitleStreams, List<MediaStream> subtitleStreams,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
var inputPath = mediaSource.Path; var inputPath = _mediaEncoder.GetInputArgument(mediaSource.Path, mediaSource);
var outputPaths = new List<string>(); var outputPaths = new List<string>();
var args = string.Format( var args = string.Format(
CultureInfo.InvariantCulture, CultureInfo.InvariantCulture,
"-i \"{0}\" -copyts", "-i {0} -copyts",
inputPath); inputPath);
foreach (var subtitleStream in subtitleStreams) foreach (var subtitleStream in subtitleStreams)
@ -676,7 +676,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
var processArgs = string.Format( var processArgs = string.Format(
CultureInfo.InvariantCulture, CultureInfo.InvariantCulture,
"-i \"{0}\" -copyts -map 0:{1} -an -vn -c:s {2} \"{3}\"", "-i {0} -copyts -map 0:{1} -an -vn -c:s {2} \"{3}\"",
inputPath, inputPath,
subtitleStreamIndex, subtitleStreamIndex,
outputCodec, outputCodec,