Skip to content

The Free Software Media System - Server Backend & API

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

Dmitry Lyzo47b583456aa8
diff --git a/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs b/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs
index d9dceee55a..f2e88c76ff 100644
--- a/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs
+++ b/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs
@@ -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)
{