소스 검색

Fix localization of audio title

Maybe passing ILocalizationManager into the ctor of MediaStream is a better solution for master?
Bond_009 1 년 전
부모
커밋
5bab02fa54
2개의 변경된 파일10개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 4
      Emby.Server.Implementations/Data/SqliteItemRepository.cs
  2. 2 0
      MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs

+ 8 - 4
Emby.Server.Implementations/Data/SqliteItemRepository.cs

@@ -5694,13 +5694,17 @@ AND Type = @InternalPersonType)");
 
             item.IsHearingImpaired = reader.TryGetBoolean(43, out var result) && result;
 
-            if (item.Type == MediaStreamType.Subtitle)
+            if (item.Type is MediaStreamType.Audio or MediaStreamType.Subtitle)
             {
-                item.LocalizedUndefined = _localization.GetLocalizedString("Undefined");
                 item.LocalizedDefault = _localization.GetLocalizedString("Default");
-                item.LocalizedForced = _localization.GetLocalizedString("Forced");
                 item.LocalizedExternal = _localization.GetLocalizedString("External");
-                item.LocalizedHearingImpaired = _localization.GetLocalizedString("HearingImpaired");
+
+                if (item.Type is MediaStreamType.Subtitle)
+                {
+                    item.LocalizedUndefined = _localization.GetLocalizedString("Undefined");
+                    item.LocalizedForced = _localization.GetLocalizedString("Forced");
+                    item.LocalizedHearingImpaired = _localization.GetLocalizedString("HearingImpaired");
+                }
             }
 
             return item;

+ 2 - 0
MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs

@@ -721,6 +721,8 @@ namespace MediaBrowser.MediaEncoding.Probing
             if (streamInfo.CodecType == CodecType.Audio)
             {
                 stream.Type = MediaStreamType.Audio;
+                stream.LocalizedDefault = _localization.GetLocalizedString("Default");
+                stream.LocalizedExternal = _localization.GetLocalizedString("External");
 
                 stream.Channels = streamInfo.Channels;