Merge pull request #12065 from Rivenlalala/fix-bdmv-file-extension-case-issue

Make m2ts extension case-insensitive
This commit is contained in:
Bond-009 2024-06-15 17:52:05 +02:00 committed by GitHub
commit f2a5ccf102
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();
}