Skip to content

The Free Software Media System - Server Backend & API

Backport pull request #12065 from jellyfin/release-10.9.z

Rivenlalala7d438a748fb9
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index f85510dac7..d0d41c2d38 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -1155,10 +1155,10 @@ namespace MediaBrowser.MediaEncoding.Encoder
// Get all files from the BDMV/STREAMING directory
// Only return playable local .m2ts files
+ var files = _fileSystem.GetFiles(Path.Join(path, "BDMV", "STREAM")).ToList();
return validPlaybackFiles
- .Select(f => _fileSystem.GetFileInfo(Path.Join(path, "BDMV", "STREAM", f)))
- .Where(f => f.Exists)
- .Select(f => f.FullName)
+ .Select(validFile => files.FirstOrDefault(f => Path.GetFileName(f.FullName.AsSpan()).Equals(validFile, StringComparison.OrdinalIgnoreCase))?.FullName)
+ .Where(f => f is not null)
.ToList();
}