test: collect candidate audio streams if no audio index is specified

To be consistent with the logic of StreamBuilder.
This commit is contained in:
Dmitry Lyzo 2024-02-20 21:32:54 +03:00
parent ca21a80c95
commit 47b583456a

View File

@ -459,8 +459,16 @@ namespace Jellyfin.Model.Tests
// Audio stream not specified
else
{
// TODO: Fixme
Assert.All(audioStreams, stream =>
bool isDefault = targetAudioStream?.IsDefault == true;
var language = targetAudioStream?.Language;
// Collect candidate audio streams
var candidateAudioStreams = audioStreams.Where(stream =>
{
return isDefault ? stream.IsDefault : (stream.Language == language);
});
Assert.All(candidateAudioStreams, stream =>
{
if (!stream.IsExternal)
{