Added MediaInfo AudioLanguagesAll.

closes #3190
This commit is contained in:
Taloth Saldono 2019-07-14 12:14:31 +02:00
parent d2764cee2a
commit 18ead9a64f
2 changed files with 35 additions and 0 deletions

View File

@ -741,6 +741,38 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
.Should().Be(releaseGroup);
}
[TestCase("English", "")]
[TestCase("English/German", "[EN+DE]")]
public void should_format_audio_languages(string audioLanguages, string expected)
{
_episodeFile.ReleaseGroup = null;
GivenMediaInfoModel(audioLanguages: audioLanguages);
_namingConfig.StandardEpisodeFormat = "{MediaInfo AudioLanguages}";
Subject.BuildFileName(new List<Episode> { _episode1 }, _series, _episodeFile)
.Should().Be(expected);
}
[TestCase("English", "[EN]")]
[TestCase("English/German", "[EN+DE]")]
public void should_format_audio_languages_all(string audioLanguages, string expected)
{
_episodeFile.ReleaseGroup = null;
GivenMediaInfoModel(audioLanguages: audioLanguages);
_namingConfig.StandardEpisodeFormat = "{MediaInfo AudioLanguagesAll}";
Subject.BuildFileName(new List<Episode> { _episode1 }, _series, _episodeFile)
.Should().Be(expected);
}
[TestCase(8, "BT.601 NTSC", "BT.709", "South.Park.S15E06.City.Sushi")]
[TestCase(10, "BT.2020", "PQ", "South.Park.S15E06.City.Sushi.HDR")]
[TestCase(10, "BT.2020", "HLG", "South.Park.S15E06.City.Sushi.HDR")]

View File

@ -583,6 +583,7 @@ namespace NzbDrone.Core.Organizer
mediaInfoAudioLanguages = $"[{mediaInfoAudioLanguages}]";
}
var mediaInfoAudioLanguagesAll = mediaInfoAudioLanguages;
if (mediaInfoAudioLanguages == "[EN]")
{
mediaInfoAudioLanguages = string.Empty;
@ -607,8 +608,10 @@ namespace NzbDrone.Core.Organizer
tokenHandlers["{MediaInfo AudioCodec}"] = m => audioCodec;
tokenHandlers["{MediaInfo AudioChannels}"] = m => audioChannelsFormatted;
tokenHandlers["{MediaInfo AudioLanguages}"] = m => mediaInfoAudioLanguages;
tokenHandlers["{MediaInfo AudioLanguagesAll}"] = m => mediaInfoAudioLanguagesAll;
tokenHandlers["{MediaInfo SubtitleLanguages}"] = m => mediaInfoSubtitleLanguages;
tokenHandlers["{MediaInfo SubtitleLanguagesAll}"] = m => mediaInfoSubtitleLanguages;
tokenHandlers["{MediaInfo Simple}"] = m => $"{videoCodec} {audioCodec}";