소스 검색

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

To be consistent with the logic of StreamBuilder.
Dmitry Lyzo 1 년 전
부모
커밋
47b583456a
1개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. 10 2
      tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs

+ 10 - 2
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)
                                 {