Shorten calculation of audio startIndex in MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs

Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
This commit is contained in:
Jonas Resch 2021-11-24 21:53:36 +01:00 committed by Jonas Resch
parent 9978164438
commit c1a8385c9c

View File

@ -591,7 +591,7 @@ namespace MediaBrowser.Providers.MediaInfo
{
var audioResolver = new AudioResolver(_localization, _mediaEncoder, cancellationToken);
var startIndex = currentStreams.Count == 0 ? 0 : (currentStreams.Select(i => i.Index).Max() + 1);
var startIndex = currentStreams.Count == 0 ? 0 : currentStreams.Max(i => i.Index) + 1;
var externalAudioStreams = audioResolver.GetExternalAudioStreams(video, startIndex, options.DirectoryService, false);
video.AudioFiles = externalAudioStreams.Select(i => i.Path).ToArray();