|
|
@ -100,25 +100,28 @@ namespace MediaBrowser.Providers.MediaInfo
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var pathInfo in pathInfos)
|
|
|
|
foreach (var pathInfo in pathInfos)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var mediaInfo = await GetMediaInfo(pathInfo.Path, _type, cancellationToken).ConfigureAwait(false);
|
|
|
|
if (!pathInfo.Path.AsSpan().EndsWith(".strm", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
|
|
|
|
|
if (mediaInfo.MediaStreams.Count == 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MediaStream mediaStream = mediaInfo.MediaStreams[0];
|
|
|
|
var mediaInfo = await GetMediaInfo(pathInfo.Path, _type, cancellationToken).ConfigureAwait(false);
|
|
|
|
mediaStream.Index = startIndex++;
|
|
|
|
|
|
|
|
mediaStream.IsDefault = pathInfo.IsDefault || mediaStream.IsDefault;
|
|
|
|
|
|
|
|
mediaStream.IsForced = pathInfo.IsForced || mediaStream.IsForced;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mediaStreams.Add(MergeMetadata(mediaStream, pathInfo));
|
|
|
|
if (mediaInfo.MediaStreams.Count == 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (MediaStream mediaStream in mediaInfo.MediaStreams)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
MediaStream mediaStream = mediaInfo.MediaStreams[0];
|
|
|
|
mediaStream.Index = startIndex++;
|
|
|
|
mediaStream.Index = startIndex++;
|
|
|
|
|
|
|
|
mediaStream.IsDefault = pathInfo.IsDefault || mediaStream.IsDefault;
|
|
|
|
|
|
|
|
mediaStream.IsForced = pathInfo.IsForced || mediaStream.IsForced;
|
|
|
|
|
|
|
|
|
|
|
|
mediaStreams.Add(MergeMetadata(mediaStream, pathInfo));
|
|
|
|
mediaStreams.Add(MergeMetadata(mediaStream, pathInfo));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (MediaStream mediaStream in mediaInfo.MediaStreams)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mediaStream.Index = startIndex++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mediaStreams.Add(MergeMetadata(mediaStream, pathInfo));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|