diff options
| author | Bond-009 <bond.009@outlook.com> | 2024-07-21 00:58:05 -0400 |
|---|---|---|
| committer | Joshua M. Boniface <joshua@boniface.me> | 2024-07-21 00:58:05 -0400 |
| commit | 46fde9aa04377d151cce128978e4eb9c54b86d98 (patch) | |
| tree | 582b786fdd82686ec27e2638dd4da163144aa00c | |
| parent | a8ac58fd5b13ae93879cb78ab6c57f22dbf9ac72 (diff) | |
Backport pull request #12278 from jellyfin/release-10.9.z
Fix localization of audio title
Original-merge: f7a90b6383aed557c0c2d3a824fc00340f72fe40
Merged-by: Bond-009 <bond.009@outlook.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
3 files changed, 11 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index c2e3312ab..5094dcf0d 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/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; diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index f5185398c..c8bd1eb7f 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/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; diff --git a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs index 020e20fb8..612064190 100644 --- a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs +++ b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs @@ -18,7 +18,7 @@ namespace Jellyfin.MediaEncoding.Tests.Probing public class ProbeResultNormalizerTests { private readonly JsonSerializerOptions _jsonOptions; - private readonly ProbeResultNormalizer _probeResultNormalizer = new ProbeResultNormalizer(new NullLogger<EncoderValidatorTests>(), null); + private readonly ProbeResultNormalizer _probeResultNormalizer = new ProbeResultNormalizer(new NullLogger<EncoderValidatorTests>(), new Mock<ILocalizationManager>().Object); public ProbeResultNormalizerTests() { |
