Extract condition from Where clause to eliminate extra filtering (#12614)

This commit is contained in:
Dmitry Lyzo 2024-09-09 16:51:28 +03:00 committed by GitHub
parent ae1dd5b1fc
commit 54f663b0f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -805,9 +805,13 @@ namespace MediaBrowser.Model.Dlna
}
var transcodingProfiles = options.Profile.TranscodingProfiles
.Where(i => !item.UseMostCompatibleTranscodingProfile || string.Equals(i.Container, "ts", StringComparison.OrdinalIgnoreCase))
.Where(i => i.Type == playlistItem.MediaType && i.Context == options.Context);
if (item.UseMostCompatibleTranscodingProfile)
{
transcodingProfiles = transcodingProfiles.Where(i => string.Equals(i.Container, "ts", StringComparison.OrdinalIgnoreCase));
}
if (options.AllowVideoStreamCopy)
{
// prefer direct copy profile